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>] [day] [month] [year] [list]
Message-Id: <E1ZFqHt-0001tq-1h@finisterre>
Date:	Thu, 16 Jul 2015 22:01:49 +0100
From:	Mark Brown <broonie@...nel.org>
To:	Javier Martinez Canillas <javier@....samsung.com>,
	Mark Brown <broonie@...nel.org>
Cc:	linux-kernel@...r.kernel.org
Subject: Applied "regulator: core: Increase refcount for regulator supply's module" to the regulator tree

The patch

   regulator: core: Increase refcount for regulator supply's module

has been applied to the regulator tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From e2c09ae7a74d94222187edbe8f5cf1fa9364efcd Mon Sep 17 00:00:00 2001
From: Javier Martinez Canillas <javier@....samsung.com>
Date: Wed, 15 Jul 2015 16:10:28 +0200
Subject: [PATCH] regulator: core: Increase refcount for regulator supply's
 module

When a regulator is unregistered with regulator_unregister(), a call to
regulator_put() is made for its input supply if there is one. This does
a module_put() to decrement the refcount of the module that owns the
supply but there isn't a corresponding try_module_get() in set_supply()
to make the calls balanced.

Signed-off-by: Javier Martinez Canillas <javier@....samsung.com>
Signed-off-by: Mark Brown <broonie@...nel.org>
---
 drivers/regulator/core.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index c9f7201..934fde4 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -1105,6 +1105,9 @@ static int set_supply(struct regulator_dev *rdev,
 
 	rdev_info(rdev, "supplied by %s\n", rdev_get_name(supply_rdev));
 
+	if (!try_module_get(supply_rdev->owner))
+		return -ENODEV;
+
 	rdev->supply = create_regulator(supply_rdev, &rdev->dev, "SUPPLY");
 	if (rdev->supply == NULL) {
 		err = -ENOMEM;
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ