mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-01 14:44:12 +00:00
media: tuners: qt1010: replace BUG_ON with a regular error
[ Upstream commit ee630b29ea
]
BUG_ON is unnecessary here, and in addition it confuses smatch.
Replacing this with an error return help resolve this smatch
warning:
drivers/media/tuners/qt1010.c:350 qt1010_init() error: buffer overflow 'i2c_data' 34 <= 34
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
0fa0585aeb
commit
1a6bf53fff
1 changed files with 6 additions and 5 deletions
|
@ -345,11 +345,12 @@ static int qt1010_init(struct dvb_frontend *fe)
|
|||
else
|
||||
valptr = &tmpval;
|
||||
|
||||
BUG_ON(i >= ARRAY_SIZE(i2c_data) - 1);
|
||||
|
||||
err = qt1010_init_meas1(priv, i2c_data[i+1].reg,
|
||||
i2c_data[i].reg,
|
||||
i2c_data[i].val, valptr);
|
||||
if (i >= ARRAY_SIZE(i2c_data) - 1)
|
||||
err = -EIO;
|
||||
else
|
||||
err = qt1010_init_meas1(priv, i2c_data[i + 1].reg,
|
||||
i2c_data[i].reg,
|
||||
i2c_data[i].val, valptr);
|
||||
i++;
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue