OSDN Git Service

iio: buffer: check if a buffer has been set up when poll is called
authorStefan Windfeldt-Prytz <stefan.windfeldt@axis.com>
Thu, 15 Feb 2018 14:02:53 +0000 (15:02 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 28 Feb 2018 09:18:31 +0000 (10:18 +0100)
commit97e604775d4170c4c6daea5318adf43d7a1f7f5f
tree0fd2ba8ba34c3320a808d82f95e7d1e5ad2cb6fd
parent239ef9cf2695c7e6d2d0dc673b34a4123dde7425
iio: buffer: check if a buffer has been set up when poll is called

commit 4cd140bda6494543f1c1b0ccceceaa44b676eef6 upstream.

If no iio buffer has been set up and poll is called return 0.
Without this check there will be a null pointer dereference when
calling poll on a iio driver without an iio buffer.

Cc: stable@vger.kernel.org
Signed-off-by: Stefan Windfeldt-Prytz <stefan.windfeldt@axis.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iio/industrialio-buffer.c