media: atomisp: fix uninitialized bug in gmin_get_pmic_id_and_addr()
Subsystems (5)
Media (V4L/DVB) Staging Kernel janitors Intel MID (Mobile Internet Device) platform +1 more subsystems
PATCH 1/1 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.
Fixes c30f4cb2d4c7 ("media: atomisp: Refactor PMIC detection to a separate function")
Signed-off-by Dan Carpenter <[email protected]>
--- drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c +1 -1
@@ -481,7 +481,7 @@ static int atomisp_get_acpi_power(struct device *dev)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)
Signature · 1 line
2.20.1
Quoting Dan Carpenter (2021-10-12 09:21:50)
Quoted 3 lines
The "power" pointer is not initialized on the else path and that would lead to an Oops.
Yes, that looks like a good catch.
Reviewed-by Kieran Bingham <[email protected]>
Quoted 22 lines
Fixes c30f4cb2d4c7 ("media: atomisp: Refactor PMIC detection to a separate function")Signed-off-by Dan Carpenter <[email protected]>--- drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c +1
-1@@ -481,7 +481,7 @@ static int atomisp_get_acpi_power(struct device *dev)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)Signature · 1 line
2.20.1