iio: buffer: check if a buffer has been set up when poll is called

commit 4cd140bda6 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.

Signed-off-by: Stefan Windfeldt-Prytz <stefan.windfeldt@axis.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
This commit is contained in:
Stefan Windfeldt-Prytz 2018-02-15 15:02:53 +01:00 • committed by Ben Hutchings
commit 11c45a46ca