mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 02:50:49 +09:00
ASoC: Variable "val" in function rt274_i2c_probe() could be uninitialized
[ Upstream commit 8c3590de0a ]
Inside function rt274_i2c_probe(), if regmap_read() function
returns -EINVAL, then local variable "val" leaves uninitialized
but used in if statement. This is potentially unsafe.
Signed-off-by: Yizhuo <yzhai003@ucr.edu>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
e7b2f9f2bc
commit
651023ed93
@@ -1126,8 +1126,11 @@ static int rt274_i2c_probe(struct i2c_client *i2c,
|
||||
return ret;
|
||||
}
|
||||
|
||||
regmap_read(rt274->regmap,
|
||||
ret = regmap_read(rt274->regmap,
|
||||
RT274_GET_PARAM(AC_NODE_ROOT, AC_PAR_VENDOR_ID), &val);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (val != RT274_VENDOR_ID) {
|
||||
dev_err(&i2c->dev,
|
||||
"Device with ID register %#x is not rt274\n", val);
|
||||
|
||||
Reference in New Issue
Block a user