summaryrefslogtreecommitdiff
path: root/drivers/iio/inkern.c
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2015-02-04 10:43:01 -0600
committerRob Herring <robh@kernel.org>2015-02-04 10:43:01 -0600
commit962a70d05edac2e2eb53cd077715930083964b9e (patch)
treef0b3a7bd574b2edfa76ce960e7f8630aea77e257 /drivers/iio/inkern.c
parent10638a4ed2b8618f20fabf9ed19df60a68446e90 (diff)
parent26bc420b59a38e4e6685a73345a0def461136dce (diff)
Merge tag 'v3.19-rc6' into HEAD
Linux 3.19-rc6
Diffstat (limited to 'drivers/iio/inkern.c')
-rw-r--r--drivers/iio/inkern.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/iio/inkern.c b/drivers/iio/inkern.c
index 866fe904cba2..90c8cb727cc7 100644
--- a/drivers/iio/inkern.c
+++ b/drivers/iio/inkern.c
@@ -449,6 +449,9 @@ static int iio_channel_read(struct iio_channel *chan, int *val, int *val2,
if (val2 == NULL)
val2 = &unused;
+ if(!iio_channel_has_info(chan->channel, info))
+ return -EINVAL;
+
if (chan->indio_dev->info->read_raw_multi) {
ret = chan->indio_dev->info->read_raw_multi(chan->indio_dev,
chan->channel, INDIO_MAX_RAW_ELEMENTS,