mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2025-07-07 18:05:21 +02:00
iio: accel: bma400: Fix uninitialized variable field_value in tap event handling.
[ Upstream commitdb9795a43d
] In the current implementation, the local variable field_value is used without prior initialization, which may lead to reading uninitialized memory. Specifically, in the macro set_mask_bits, the initial (potentially uninitialized) value of the buffer is copied into old__, and a mask is applied to calculate new__. A similar issue was resolved in commit6ee2a7058f
("iio: accel: bma400: Fix smatch warning based on use of unintialized value."). Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes:961db2da15
("iio: accel: bma400: Add support for single and double tap events") Signed-off-by: Mikhail Lobanov <m.lobanov@rosalinux.ru> Link: https://patch.msgid.link/20240910083624.27224-1-m.lobanov@rosalinux.ru Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
18916a684a
commit
de1f0ab139
|
@ -1219,7 +1219,8 @@ static int bma400_activity_event_en(struct bma400_data *data,
|
||||||
static int bma400_tap_event_en(struct bma400_data *data,
|
static int bma400_tap_event_en(struct bma400_data *data,
|
||||||
enum iio_event_direction dir, int state)
|
enum iio_event_direction dir, int state)
|
||||||
{
|
{
|
||||||
unsigned int mask, field_value;
|
unsigned int mask;
|
||||||
|
unsigned int field_value = 0;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue
Block a user