Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dc30e703 authored by Yizhuo's avatar Yizhuo Committed by Tony Lindgren
Browse files

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: default avatarYizhuo <yzhai003@ucr.edu>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 072167d1
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -83,6 +83,7 @@ static int omap4_dsi_mux_pads(int dsi_id, unsigned lanes)
	u32 enable_mask, enable_shift;
	u32 pipd_mask, pipd_shift;
	u32 reg;
	int ret;

	if (dsi_id == 0) {
		enable_mask = OMAP4_DSI1_LANEENABLE_MASK;
@@ -98,7 +99,11 @@ static int omap4_dsi_mux_pads(int dsi_id, unsigned lanes)
		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 &= ~pipd_mask;