media: atomisp: fix uninitialized bug in gmin_get_pmic_id_and_addr()

The "power" pointer is not initialized on the else path and that would
lead to an Oops.

Link: https://lore.kernel.org/linux-media/20211012082150.GA31086@kili
Fixes: c30f4cb2d4 ("media: atomisp: Refactor PMIC detection to a separate function")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This commit is contained in:
Dan Carpenter 2021-10-12 09:21:50 +01:00 коммит произвёл Mauro Carvalho Chehab
Родитель 22f2cac62d
Коммит cb4d67a998
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -500,7 +500,7 @@ fail:
static u8 gmin_get_pmic_id_and_addr(struct device *dev)
{
struct i2c_client *power;
struct i2c_client *power = NULL;
static u8 pmic_i2c_addr;
if (pmic_id)