提交 9e76b1b5 编写于 作者: Y Yizhuo 提交者: Xie XiuQi

ARM: OMAP2+: Variable "reg" in function omap4_dsi_mux_pads() could be uninitialized

[ Upstream commit dc30e70391376ba3987aeb856ae6d9c0706534f1 ]

In function omap4_dsi_mux_pads(), local variable "reg" could
be uninitialized if function regmap_read() returns -EINVAL.
However, it will be used directly in the later context, which
is potentially unsafe.
Signed-off-by: NYizhuo <yzhai003@ucr.edu>
Signed-off-by: NTony Lindgren <tony@atomide.com>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 025687fa
...@@ -83,6 +83,7 @@ static int omap4_dsi_mux_pads(int dsi_id, unsigned lanes) ...@@ -83,6 +83,7 @@ static int omap4_dsi_mux_pads(int dsi_id, unsigned lanes)
u32 enable_mask, enable_shift; u32 enable_mask, enable_shift;
u32 pipd_mask, pipd_shift; u32 pipd_mask, pipd_shift;
u32 reg; u32 reg;
int ret;
if (dsi_id == 0) { if (dsi_id == 0) {
enable_mask = OMAP4_DSI1_LANEENABLE_MASK; enable_mask = OMAP4_DSI1_LANEENABLE_MASK;
...@@ -98,7 +99,11 @@ static int omap4_dsi_mux_pads(int dsi_id, unsigned lanes) ...@@ -98,7 +99,11 @@ static int omap4_dsi_mux_pads(int dsi_id, unsigned lanes)
return -ENODEV; return -ENODEV;
} }
regmap_read(omap4_dsi_mux_syscon, OMAP4_DSIPHY_SYSCON_OFFSET, &reg); ret = regmap_read(omap4_dsi_mux_syscon,
OMAP4_DSIPHY_SYSCON_OFFSET,
&reg);
if (ret)
return ret;
reg &= ~enable_mask; reg &= ~enable_mask;
reg &= ~pipd_mask; reg &= ~pipd_mask;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册