diff options
-rw-r--r-- | drivers/iio/industrialio-buffer.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c index 2f35db93cdb6..3d8d187eef2a 100644 --- a/drivers/iio/industrialio-buffer.c +++ b/drivers/iio/industrialio-buffer.c | |||
@@ -285,6 +285,9 @@ int iio_buffer_register(struct iio_dev *indio_dev, | |||
285 | if (channels) { | 285 | if (channels) { |
286 | /* new magic */ | 286 | /* new magic */ |
287 | for (i = 0; i < num_channels; i++) { | 287 | for (i = 0; i < num_channels; i++) { |
288 | if (channels[i].scan_index < 0) | ||
289 | continue; | ||
290 | |||
288 | /* Establish necessary mask length */ | 291 | /* Establish necessary mask length */ |
289 | if (channels[i].scan_index > | 292 | if (channels[i].scan_index > |
290 | (int)indio_dev->masklength - 1) | 293 | (int)indio_dev->masklength - 1) |