media: atomisp: fix the uninitialized use and rename "retvalue"
authorYizhuo <yzhai003@ucr.edu>
Fri, 25 Jun 2021 05:38:56 +0000 (07:38 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 15 Sep 2021 07:50:34 +0000 (09:50 +0200)
commite9a62740876b286cae4ceb0de4d1d1a04b1e6b0c
tree596572fb3acf537bacc971f0dc68fe9e014fc103
parentb0e87701b81340af19a265308dd3f990fb4afed3
media: atomisp: fix the uninitialized use and rename "retvalue"

[ Upstream commit c275e5d349b0d2b1143607d28b9c7c14a8a0a9b4 ]

Inside function mt9m114_detect(), variable "retvalue" could
be uninitialized if mt9m114_read_reg() returns error, however, it
is used in the later if statement, which is potentially unsafe.

The local variable "retvalue" is renamed to "model" to avoid
confusion.

Link: https://lore.kernel.org/linux-media/20210625053858.3862-1-yzhai003@ucr.edu
Fixes: ad85094 (media / atomisp: fix the uninitialized use of model ID)
Signed-off-by: Yizhuo <yzhai003@ucr.edu>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c