android_kernel_xiaomi_sm8350/drivers/iio/accel
Harshit Mogalapalli f5b76a8166 iio: accel: mma9551_core: Prevent uninitialized variable in mma9551_read_config_word()
[ Upstream commit 64a68158738ec8f520347144352f7a09bdb9e169 ]

Smatch Warns:
drivers/iio/accel/mma9551_core.c:299
	mma9551_read_config_word() error: uninitialized symbol 'v'.

When (offset >= 1 << 12) is true mma9551_transfer() will return -EINVAL
without 'v' being initialized, so check for the error and return.

Note: No actual bug as caller checks the return value and does not
use the parameter in the problem case.

Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Link: https://lore.kernel.org/r/20230126153610.3586243-1-harshit.m.mogalapalli@oracle.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-03-11 16:44:15 +01:00
..
adis16201.c
adis16209.c
adxl345_core.c
adxl345_i2c.c
adxl345_spi.c
adxl345.h
adxl372_i2c.c
adxl372_spi.c
adxl372.c
adxl372.h
bma180.c
bma220_spi.c
bmc150-accel-core.c
bmc150-accel-i2c.c
bmc150-accel-spi.c
bmc150-accel.h
cros_ec_accel_legacy.c
da280.c
da311.c
dmard06.c
dmard09.c
dmard10.c
hid-sensor-accel-3d.c
Kconfig
kxcjk-1013.c
kxsd9-i2c.c
kxsd9-spi.c
kxsd9.c
kxsd9.h
Makefile
mc3230.c
mma7455_core.c
mma7455_i2c.c
mma7455_spi.c
mma7455.h
mma7660.c
mma8452.c
mma9551_core.c
mma9551_core.h
mma9551.c
mma9553.c
mxc4005.c
mxc6255.c
sca3000.c
ssp_accel_sensor.c
st_accel_buffer.c
st_accel_core.c
st_accel_i2c.c
st_accel_spi.c
st_accel.h
stk8ba50.c
stk8312.c