summaryrefslogtreecommitdiffstats
path: root/drivers/iio/gyro
diff options
context:
space:
mode:
authorIoana Ciornei <ciorneiioana@gmail.com>2015-11-01 14:58:44 +0200
committerJonathan Cameron <jic23@kernel.org>2015-11-08 15:43:16 +0000
commita106b4748917ba510d083217dbc25e56299f32d4 (patch)
tree829246e069649d2e2383fb1023022882e71d5481 /drivers/iio/gyro
parent7d0ead5c3f00a0652fa4436f0d2dd05e9f2de140 (diff)
downloadlinux-a106b4748917ba510d083217dbc25e56299f32d4.tar.bz2
iio: gyro: check sscanf return value
This patch fixes the checkpatch warnings: WARNING: unchecked sscanf return value Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio/gyro')
-rw-r--r--drivers/iio/gyro/adis16136.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/iio/gyro/adis16136.c b/drivers/iio/gyro/adis16136.c
index 26de876b223d..bb09bff25103 100644
--- a/drivers/iio/gyro/adis16136.c
+++ b/drivers/iio/gyro/adis16136.c
@@ -435,7 +435,9 @@ static int adis16136_initial_setup(struct iio_dev *indio_dev)
if (ret)
return ret;
- sscanf(indio_dev->name, "adis%u\n", &device_id);
+ ret = sscanf(indio_dev->name, "adis%u\n", &device_id);
+ if (ret != 1)
+ return -EINVAL;
if (prod_id != device_id)
dev_warn(&indio_dev->dev, "Device ID(%u) and product ID(%u) do not match.",