From: Dan Carpenter Date: Tue, 12 Oct 2021 08:21:50 +0000 (+0100) Subject: media: atomisp: fix uninitialized bug in gmin_get_pmic_id_and_addr() X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=cb4d67a998e97365afdf34965b069601da1dae60;p=uclinux-h8%2Flinux.git 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: c30f4cb2d4c7 ("media: atomisp: Refactor PMIC detection to a separate function") Signed-off-by: Dan Carpenter Reviewed-by: Kieran Bingham Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c b/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c index 948eb6f809f5..1cc581074ba7 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c +++ b/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c @@ -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)