Re: [PATCH 4.19 249/276] media: si2165: fix a missing check of return value

From: Pavel Machek
Date: Thu Jun 06 2019 - 08:54:16 EST


Hi!

> [ Upstream commit 0ab34a08812a3334350dbaf69a018ee0ab3d2ddd ]
>
> si2165_readreg8() may fail. Looking into si2165_readreg8(), we will find
> that "val_tmp" will be an uninitialized value when regmap_read() fails.
> "val_tmp" is then assigned to "val". So if si2165_readreg8() fails,
> "val" will be a random value. Further use will lead to undefined
> behaviors. The fix checks if si2165_readreg8() fails, and if so, returns
> its error code upstream.

Ok, but there's still undefined behaviour in si2165_readreg8, 16 and
24, where it manipulates and prints uninitialized memory, right?

Pavel

--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

Attachment: signature.asc
Description: Digital signature