diff options
author | Tony Lindgren <tony@atomide.com> | 2019-03-21 11:00:21 -0700 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2019-09-23 21:11:35 +0100 |
commit | c59828dd94fa2269edad8594d8335331c984db12 (patch) | |
tree | 6aad7c5f46dd8024182449cc82c936cb6d2006a7 /arch | |
parent | 628e3360335edae69ef52484439bc7a1e985415d (diff) | |
download | linux-stable-c59828dd94fa2269edad8594d8335331c984db12.tar.gz linux-stable-c59828dd94fa2269edad8594d8335331c984db12.tar.bz2 linux-stable-c59828dd94fa2269edad8594d8335331c984db12.zip |
ARM: OMAP2+: Fix potentially uninitialized return value for _setup_reset()
commit 7f0d078667a494466991aa7133f49594f32ff6a2 upstream.
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>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-omap2/omap_hwmod.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index a0ec4616d7a5..a6987039699a 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c @@ -2617,7 +2617,7 @@ static void __init _setup_iclk_autoidle(struct omap_hwmod *oh) */ static int __init _setup_reset(struct omap_hwmod *oh) { - int r; + int r = 0; if (oh->_state != _HWMOD_STATE_INITIALIZED) return -EINVAL; |