diff options
author | Yizhuo <yzhai003@ucr.edu> | 2019-01-25 22:32:20 -0800 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2019-01-29 08:54:22 -0800 |
commit | dc30e70391376ba3987aeb856ae6d9c0706534f1 (patch) | |
tree | 7017561cfc2c451e3a22631e3d6c98e16af5f3ae /arch/arm | |
parent | 072167d13ce46d5fcef1a80a53a667a46c9b17e7 (diff) | |
download | linux-dc30e70391376ba3987aeb856ae6d9c0706534f1.tar.gz linux-dc30e70391376ba3987aeb856ae6d9c0706534f1.tar.bz2 linux-dc30e70391376ba3987aeb856ae6d9c0706534f1.zip |
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>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-omap2/display.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c index f86b72d1d59e..1444b4b4bd9f 100644 --- a/arch/arm/mach-omap2/display.c +++ b/arch/arm/mach-omap2/display.c @@ -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, ®); + ret = regmap_read(omap4_dsi_mux_syscon, + OMAP4_DSIPHY_SYSCON_OFFSET, + ®); + if (ret) + return ret; reg &= ~enable_mask; reg &= ~pipd_mask; |