diff options
author | Ioana Ciornei <ciorneiioana@gmail.com> | 2015-11-01 15:58:45 +0300 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2015-11-08 18:44:10 +0300 |
commit | 72a868b38bdd60cbc4084a91fd7b8df3e2bb96ba (patch) | |
tree | 8e7ff9ec5d6ce43c24005d648fd82f04ad970c78 /drivers/iio/imu/adis16400_core.c | |
parent | a106b4748917ba510d083217dbc25e56299f32d4 (diff) | |
download | linux-72a868b38bdd60cbc4084a91fd7b8df3e2bb96ba.tar.xz |
iio: imu: check sscanf return value
This patch fixes the following checkpatch warning:
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/imu/adis16400_core.c')
-rw-r--r-- | drivers/iio/imu/adis16400_core.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/iio/imu/adis16400_core.c b/drivers/iio/imu/adis16400_core.c index abc4c50de9e8..72bcc2491d1d 100644 --- a/drivers/iio/imu/adis16400_core.c +++ b/drivers/iio/imu/adis16400_core.c @@ -288,7 +288,11 @@ static int adis16400_initial_setup(struct iio_dev *indio_dev) if (ret) goto err_ret; - sscanf(indio_dev->name, "adis%u\n", &device_id); + ret = sscanf(indio_dev->name, "adis%u\n", &device_id); + if (ret != 1) { + ret = -EINVAL; + goto err_ret; + } if (prod_id != device_id) dev_warn(&indio_dev->dev, "Device ID(%u) and product ID(%u) do not match.", |