]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
media: si2165: fix a missing check of return value
authorKangjie Lu <kjlu@umn.edu>
Fri, 21 Dec 2018 04:54:03 +0000 (23:54 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 31 May 2019 13:45:18 +0000 (06:45 -0700)
commitd8b24a6f181239118cc6aaefef7eaf105fbfa9f8
treed47cf5f349b82001a3c0566abefdbc1c929ec4fe
parent3c910a02c9ba1862497776d349b968123e7e31be
media: si2165: fix a missing check of return value

[ 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.

Signed-off-by: Kangjie Lu <kjlu@umn.edu>
Reviewed-by: Matthias Schwarzott <zzam@gentoo.org>
Tested-by: Matthias Schwarzott <zzam@gentoo.org>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/dvb-frontends/si2165.c