Skip to content

Commit dc30e70

Browse files
Yizhuotmlind
authored andcommitted
ARM: OMAP2+: Variable "reg" in function omap4_dsi_mux_pads() could be uninitialized
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: Yizhuo <yzhai003@ucr.edu> Signed-off-by: Tony Lindgren <tony@atomide.com>
1 parent 072167d commit dc30e70

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

arch/arm/mach-omap2/display.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ static int omap4_dsi_mux_pads(int dsi_id, unsigned lanes)
8383
u32 enable_mask, enable_shift;
8484
u32 pipd_mask, pipd_shift;
8585
u32 reg;
86+
int ret;
8687

8788
if (dsi_id == 0) {
8889
enable_mask = OMAP4_DSI1_LANEENABLE_MASK;
@@ -98,7 +99,11 @@ static int omap4_dsi_mux_pads(int dsi_id, unsigned lanes)
9899
return -ENODEV;
99100
}
100101

101-
regmap_read(omap4_dsi_mux_syscon, OMAP4_DSIPHY_SYSCON_OFFSET, &reg);
102+
ret = regmap_read(omap4_dsi_mux_syscon,
103+
OMAP4_DSIPHY_SYSCON_OFFSET,
104+
&reg);
105+
if (ret)
106+
return ret;
102107

103108
reg &= ~enable_mask;
104109
reg &= ~pipd_mask;

0 commit comments

Comments
 (0)