* Patch "regulator: core: Correct return value check in regulator_resolve_supply" has been added to the 4.2-stable tree
@ 2015-10-17 20:17 gregkh
0 siblings, 0 replies; only message in thread
From: gregkh @ 2015-10-17 20:17 UTC (permalink / raw)
To: ckeepax, broonie, gregkh; +Cc: stable, stable-commits
This is a note to let you know that I've just added the patch titled
regulator: core: Correct return value check in regulator_resolve_supply
to the 4.2-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
regulator-core-correct-return-value-check-in-regulator_resolve_supply.patch
and it can be found in the queue-4.2 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.
>From 23c3f310e897837aeb8ffe8700b803cb58e7b35d Mon Sep 17 00:00:00 2001
From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Date: Thu, 17 Sep 2015 14:50:20 +0100
Subject: regulator: core: Correct return value check in regulator_resolve_supply
From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
commit 23c3f310e897837aeb8ffe8700b803cb58e7b35d upstream.
The ret pointer passed to regulator_dev_lookup is only filled with a
valid error code if regulator_dev_lookup returned NULL. Currently
regulator_resolve_supply checks this ret value before it checks if a
regulator was returned, this can result in valid regulator lookups being
ignored.
Fixes: 6261b06de565 ("regulator: Defer lookup of supply to regulator_get")
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/regulator/core.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -1376,15 +1376,15 @@ static int regulator_resolve_supply(stru
return 0;
r = regulator_dev_lookup(dev, rdev->supply_name, &ret);
- if (ret == -ENODEV) {
- /*
- * No supply was specified for this regulator and
- * there will never be one.
- */
- return 0;
- }
-
if (!r) {
+ if (ret == -ENODEV) {
+ /*
+ * No supply was specified for this regulator and
+ * there will never be one.
+ */
+ return 0;
+ }
+
if (have_full_constraints()) {
r = dummy_regulator_rdev;
} else {
Patches currently in stable-queue which might be from ckeepax@opensource.wolfsonmicro.com are
queue-4.2/regulator-core-correct-return-value-check-in-regulator_resolve_supply.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-10-17 20:17 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-17 20:17 Patch "regulator: core: Correct return value check in regulator_resolve_supply" has been added to the 4.2-stable tree gregkh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox