stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Patch "regulator: core: Clear the supply pointer if enabling fails" has been added to the 4.4-stable tree
@ 2017-04-30 12:38 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2017-04-30 12:38 UTC (permalink / raw)
  To: jonathanh, broonie, gregkh, julia.lawall; +Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    regulator: core: Clear the supply pointer if enabling fails

to the 4.4-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-clear-the-supply-pointer-if-enabling-fails.patch
and it can be found in the queue-4.4 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 8e5356a73604f53da6a1e0756727cb8f9f7bba17 Mon Sep 17 00:00:00 2001
From: Jon Hunter <jonathanh@nvidia.com>
Date: Thu, 21 Apr 2016 17:11:58 +0100
Subject: regulator: core: Clear the supply pointer if enabling fails

From: Jon Hunter <jonathanh@nvidia.com>

commit 8e5356a73604f53da6a1e0756727cb8f9f7bba17 upstream.

During the resolution of a regulator's supply, we may attempt to enable
the supply if the regulator itself is already enabled. If enabling the
supply fails, then we will call _regulator_put() for the supply.
However, the pointer to the supply has not been cleared for the
regulator and this will cause a crash if we then unregister the
regulator and attempt to call regulator_put() a second time for the
supply. Fix this by clearing the supply pointer if enabling the supply
after fails when resolving the supply for a regulator.

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/regulator/core.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -1519,6 +1519,7 @@ static int regulator_resolve_supply(stru
 		ret = regulator_enable(rdev->supply);
 		if (ret < 0) {
 			_regulator_put(rdev->supply);
+			rdev->supply = NULL;
 			return ret;
 		}
 	}


Patches currently in stable-queue which might be from jonathanh@nvidia.com are

queue-4.4/regulator-core-clear-the-supply-pointer-if-enabling-fails.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-04-30 12:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-30 12:38 Patch "regulator: core: Clear the supply pointer if enabling fails" has been added to the 4.4-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;
as well as URLs for NNTP newsgroup(s).