提交 8d93fb27 编写于 作者: D Dan Carpenter 提交者: Zheng Zengkai

media: atomisp: fix uninitialized bug in gmin_get_pmic_id_and_addr()

stable inclusion
from stable-v5.10.94
commit 8d132d9dd8bae9f2d5ff153b3fe6eb31a000fe39
bugzilla: https://gitee.com/openeuler/kernel/issues/I531X9

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=8d132d9dd8bae9f2d5ff153b3fe6eb31a000fe39

--------------------------------

[ Upstream commit cb4d67a9 ]

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: c30f4cb2 ("media: atomisp: Refactor PMIC detection to a separate function")
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: NKieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
上级 1b575689
...@@ -481,7 +481,7 @@ static int atomisp_get_acpi_power(struct device *dev) ...@@ -481,7 +481,7 @@ static int atomisp_get_acpi_power(struct device *dev)
static u8 gmin_get_pmic_id_and_addr(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; static u8 pmic_i2c_addr;
if (pmic_id) if (pmic_id)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册