diff options
author | Ioana Ciornei <ciorneiioana@gmail.com> | 2015-11-01 15:58:44 +0300 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2015-11-08 18:43:16 +0300 |
commit | a106b4748917ba510d083217dbc25e56299f32d4 (patch) | |
tree | 829246e069649d2e2383fb1023022882e71d5481 /drivers/iio/gyro | |
parent | 7d0ead5c3f00a0652fa4436f0d2dd05e9f2de140 (diff) | |
download | linux-a106b4748917ba510d083217dbc25e56299f32d4.tar.xz |
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.c | 4 |
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.", |