mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 23:32:14 +00:00
iio: imu: adis: assign read val in debugfs hook only if op successful
This was also caught by the `-Wmaybe-uninitialized` warning, which
(ironically as-is) it makes quite a lot of sense to do for this.
The code that actually calls this function will fail to copy on
the uninitialized value. Hence, patch does not need to go into stable.
Fixes: 78026a6fde
("iio:imu:adis: Add debugfs register access support")
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
parent
9b742763d9
commit
38262c01ea
1 changed files with 2 additions and 1 deletions
|
@ -229,7 +229,8 @@ int adis_debugfs_reg_access(struct iio_dev *indio_dev,
|
|||
int ret;
|
||||
|
||||
ret = adis_read_reg_16(adis, reg, &val16);
|
||||
*readval = val16;
|
||||
if (ret == 0)
|
||||
*readval = val16;
|
||||
|
||||
return ret;
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue