All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: linux-omap@vger.kernel.org
Cc: Tero Kristo <t-kristo@ti.com>, Paul Walmsley <paul@pwsan.com>,
	linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/7] ARM: OMAP2+: Fix potentially uninitialized return value for _setup_reset()
Date: Mon, 25 Mar 2019 11:38:13 -0700	[thread overview]
Message-ID: <20190325183819.15400-2-tony@atomide.com> (raw)
In-Reply-To: <20190325183819.15400-1-tony@atomide.com>

Commit 747834ab8347 ("ARM: OMAP2+: hwmod: revise hardreset behavior") made
the call to _enable() conditional based on no oh->rst_lines_cnt. This
caused the return value to be potentially uninitialized. Curiously we see
no compiler warnings for this, probably as this gets inlined.

We call _setup_reset() from _setup() and only _setup_postsetup() if the
return value is zero. Currently the return value can be uninitialized for
cases where oh->rst_lines_cnt is set and HWMOD_INIT_NO_RESET is not set.

Fixes: 747834ab8347 ("ARM: OMAP2+: hwmod: revise hardreset behavior")
Cc: Paul Walmsley <paul@pwsan.com>
Cc: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/mach-omap2/omap_hwmod.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -2465,7 +2465,7 @@ static void _setup_iclk_autoidle(struct omap_hwmod *oh)
  */
 static int _setup_reset(struct omap_hwmod *oh)
 {
-	int r;
+	int r = 0;
 
 	if (oh->_state != _HWMOD_STATE_INITIALIZED)
 		return -EINVAL;
-- 
2.21.0

WARNING: multiple messages have this Message-ID (diff)
From: Tony Lindgren <tony@atomide.com>
To: linux-omap@vger.kernel.org
Cc: Tero Kristo <t-kristo@ti.com>, Paul Walmsley <paul@pwsan.com>,
	linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/7] ARM: OMAP2+: Fix potentially uninitialized return value for _setup_reset()
Date: Mon, 25 Mar 2019 11:38:13 -0700	[thread overview]
Message-ID: <20190325183819.15400-2-tony@atomide.com> (raw)
In-Reply-To: <20190325183819.15400-1-tony@atomide.com>

Commit 747834ab8347 ("ARM: OMAP2+: hwmod: revise hardreset behavior") made
the call to _enable() conditional based on no oh->rst_lines_cnt. This
caused the return value to be potentially uninitialized. Curiously we see
no compiler warnings for this, probably as this gets inlined.

We call _setup_reset() from _setup() and only _setup_postsetup() if the
return value is zero. Currently the return value can be uninitialized for
cases where oh->rst_lines_cnt is set and HWMOD_INIT_NO_RESET is not set.

Fixes: 747834ab8347 ("ARM: OMAP2+: hwmod: revise hardreset behavior")
Cc: Paul Walmsley <paul@pwsan.com>
Cc: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/mach-omap2/omap_hwmod.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -2465,7 +2465,7 @@ static void _setup_iclk_autoidle(struct omap_hwmod *oh)
  */
 static int _setup_reset(struct omap_hwmod *oh)
 {
-	int r;
+	int r = 0;
 
 	if (oh->_state != _HWMOD_STATE_INITIALIZED)
 		return -EINVAL;
-- 
2.21.0

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2019-03-25 18:38 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-25 18:38 [PATCH 0/7] omap changes to allocate struct omap_hwmod dynamically Tony Lindgren
2019-03-25 18:38 ` Tony Lindgren
2019-03-25 18:38 ` Tony Lindgren [this message]
2019-03-25 18:38   ` [PATCH 1/7] ARM: OMAP2+: Fix potentially uninitialized return value for _setup_reset() Tony Lindgren
2019-03-25 18:38 ` [PATCH 2/7] ARM: OMAP2+: Make interconnect target module allocation functions static Tony Lindgren
2019-03-25 18:38   ` Tony Lindgren
2019-03-25 18:38 ` [PATCH 3/7] ARM: OMAP2+: Prepare class allocation for dynamically allocated modules Tony Lindgren
2019-03-25 18:38   ` Tony Lindgren
2019-03-25 18:38 ` [PATCH 4/7] ARM: OMAP2+: Define _HWMOD_STATE_DEFAULT and use it Tony Lindgren
2019-03-25 18:38   ` Tony Lindgren
2019-03-25 18:38 ` [PATCH 5/7] ARM: OMAP2+: Allocate struct omap_hwmod based on dts data Tony Lindgren
2019-03-25 18:38   ` Tony Lindgren
2019-03-25 18:38 ` [PATCH 6/7] ARM: OMAP2+: Remove hwmod .rev data and use local SoC checks instead Tony Lindgren
2019-03-25 18:38   ` Tony Lindgren
2019-03-25 18:38 ` [PATCH 7/7] ARM: OMAP2+: Handle reset quirks for dynamically allocated modules Tony Lindgren
2019-03-25 18:38   ` Tony Lindgren
2019-03-26 15:36   ` Tony Lindgren
2019-03-26 15:36     ` Tony Lindgren
2019-03-28  0:28   ` Sebastian Reichel
2019-04-01 14:58     ` Tony Lindgren
2019-04-01 14:58       ` Tony Lindgren

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=20190325183819.15400-2-tony@atomide.com \
    --to=tony@atomide.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=paul@pwsan.com \
    --cc=t-kristo@ti.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.