From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Yizhuo <yzhai003@ucr.edu>, Tony Lindgren <tony@atomide.com>,
Sasha Levin <sashal@kernel.org>,
linux-omap@vger.kernel.org
Subject: [PATCH AUTOSEL 4.4 4/8] ARM: OMAP2+: Variable "reg" in function omap4_dsi_mux_pads() could be uninitialized
Date: Mon, 11 Mar 2019 15:59:34 -0400 [thread overview]
Message-ID: <20190311195938.139603-4-sashal@kernel.org> (raw)
In-Reply-To: <20190311195938.139603-1-sashal@kernel.org>
From: Yizhuo <yzhai003@ucr.edu>
[ 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: Yizhuo <yzhai003@ucr.edu>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm/mach-omap2/display.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c
index 6ab13d18c636..cde86d1199cf 100644
--- a/arch/arm/mach-omap2/display.c
+++ b/arch/arm/mach-omap2/display.c
@@ -115,6 +115,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;
@@ -130,7 +131,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;
--
2.19.1
next prev parent reply other threads:[~2019-03-11 20:00 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-11 19:59 [PATCH AUTOSEL 4.4 1/8] gpu: ipu-v3: Fix i.MX51 CSI control registers offset Sasha Levin
2019-03-11 19:59 ` [PATCH AUTOSEL 4.4 2/8] gpu: ipu-v3: Fix CSI offsets for imx53 Sasha Levin
2019-03-11 19:59 ` [PATCH AUTOSEL 4.4 3/8] s390/dasd: fix using offset into zero size array error Sasha Levin
2019-03-11 19:59 ` Sasha Levin [this message]
2019-03-11 19:59 ` [PATCH AUTOSEL 4.4 5/8] Input: matrix_keypad - use flush_delayed_work() Sasha Levin
2019-03-11 19:59 ` [PATCH AUTOSEL 4.4 6/8] team: avoid complex list operations in team_nl_cmd_options_set() Sasha Levin
2019-03-11 19:59 ` [PATCH AUTOSEL 4.4 7/8] i2c: cadence: Fix the hold bit setting Sasha Levin
2019-03-11 19:59 ` [PATCH AUTOSEL 4.4 8/8] Input: st-keyscan - fix potential zalloc NULL dereference Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190311195938.139603-4-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=tony@atomide.com \
--cc=yzhai003@ucr.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®