diff options
Diffstat (limited to 'drivers')
-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.", |