1 From 0a41df032cd31a063296ba9410691e79582d5edb Mon Sep 17 00:00:00 2001
2 From: Yizhuo <yzhai003@ucr.edu>
3 Date: Fri, 25 Jan 2019 22:32:20 -0800
4 Subject: ARM: OMAP2+: Variable "reg" in function omap4_dsi_mux_pads() could be
7 [ Upstream commit dc30e70391376ba3987aeb856ae6d9c0706534f1 ]
9 In function omap4_dsi_mux_pads(), local variable "reg" could
10 be uninitialized if function regmap_read() returns -EINVAL.
11 However, it will be used directly in the later context, which
12 is potentially unsafe.
14 Signed-off-by: Yizhuo <yzhai003@ucr.edu>
15 Signed-off-by: Tony Lindgren <tony@atomide.com>
16 Signed-off-by: Sasha Levin <sashal@kernel.org>
18 arch/arm/mach-omap2/display.c | 7 ++++++-
19 1 file changed, 6 insertions(+), 1 deletion(-)
21 diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c
22 index 6ab13d18c636..cde86d1199cf 100644
23 --- a/arch/arm/mach-omap2/display.c
24 +++ b/arch/arm/mach-omap2/display.c
25 @@ -115,6 +115,7 @@ static int omap4_dsi_mux_pads(int dsi_id, unsigned lanes)
26 u32 enable_mask, enable_shift;
27 u32 pipd_mask, pipd_shift;
32 enable_mask = OMAP4_DSI1_LANEENABLE_MASK;
33 @@ -130,7 +131,11 @@ static int omap4_dsi_mux_pads(int dsi_id, unsigned lanes)
37 - regmap_read(omap4_dsi_mux_syscon, OMAP4_DSIPHY_SYSCON_OFFSET, ®);
38 + ret = regmap_read(omap4_dsi_mux_syscon,
39 + OMAP4_DSIPHY_SYSCON_OFFSET,