From: Ian Abbott Date: Tue, 5 Feb 2013 12:50:40 +0000 (+0000) Subject: staging: comedi: check s->async for poll(), read() and write() X-Git-Tag: v3.9-rc1~127^2~118 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cc400e185c07c15a42d2635995f422de5b94b696;p=pandora-kernel.git staging: comedi: check s->async for poll(), read() and write() Some low-level comedi drivers (incorrectly) point `dev->read_subdev` or `dev->write_subdev` to a subdevice that does not support asynchronous commands. Comedi's poll(), read() and write() file operation handlers assume these subdevices do support asynchronous commands. In particular, they assume `s->async` is valid (where `s` points to the read or write subdevice), which it won't be if it has been set incorrectly. This can lead to a NULL pointer dereference. Check `s->async` is non-NULL in `comedi_poll()`, `comedi_read()` and `comedi_write()` to avoid the bug. Signed-off-by: Ian Abbott Cc: stable Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed