lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 11 Feb 2016 17:13:07 +0100
From:	Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>
To:	Viresh Kumar <viresh.kumar@...aro.org>,
	"Rafael J. Wysocki" <rafael.j.wysocki@...el.com>
Cc:	linaro-kernel@...ts.linaro.org, linux-pm@...r.kernel.org,
	Stephen Boyd <sboyd@...eaurora.org>, nm@...com,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Len Brown <len.brown@...el.com>,
	open list <linux-kernel@...r.kernel.org>,
	Pavel Machek <pavel@....cz>, Viresh Kumar <vireshk@...nel.org>,
	Rafael Wysocki <rjw@...ysocki.net>,
	Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>
Subject: [PATCH] PM / OPP: Fix NULL pointer dereference when no regulator is
 defined

Commit 7d34d56ef334 ("PM / OPP: Disable OPPs that aren't
supported by the regulator") causes NULL pointer dereference
OOPS when no regulator for OPP is defined.  Fix it by
replacing IS_ERR() check with IS_ERR_OR_NULL() one (since
providing regulator for OPP is optional).

Cc: Viresh Kumar <viresh.kumar@...aro.org>
Cc: Stephen Boyd <sboyd@...eaurora.org>
Cc: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
Fixes: 7d34d56ef334 ("PM / OPP: Disable OPPs that aren't supported by the regulator")
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>
---
This fixes linux-pm/linux-next tree boot hang regression on
Exynos4412 SoC based Odroid-U3 board.

Rafael, please apply.  Thank you!

 drivers/base/power/opp/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/base/power/opp/core.c b/drivers/base/power/opp/core.c
index ab711c2..d7cd4e2 100644
--- a/drivers/base/power/opp/core.c
+++ b/drivers/base/power/opp/core.c
@@ -975,7 +975,7 @@ static bool _opp_supported_by_regulators(struct dev_pm_opp *opp,
 {
 	struct regulator *reg = dev_opp->regulator;
 
-	if (!IS_ERR(reg) &&
+	if (!IS_ERR_OR_NULL(reg) &&
 	    !regulator_is_supported_voltage(reg, opp->u_volt_min,
 					    opp->u_volt_max)) {
 		pr_warn("%s: OPP minuV: %lu maxuV: %lu, not supported by regulator\n",
-- 
1.9.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ