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:	Mon, 24 Nov 2008 18:44:15 +0200
From:	Mike Rapoport <mike@...pulab.co.il>
To:	lrg@...mlogic.co.uk
Cc:	linux-kernel@...r.kernel.org, Mike Rapoport <mike@...pulab.co.il>
Subject: [PATCH] regulator: move set_machine_constraints after regulator device initialization

Calling set_machine_constraints before regulator device initialization
causes crash when constraints have apply_uV set.

Signed-off-by: Mike Rapoport <mike@...pulab.co.il>
---
 drivers/regulator/core.c |   17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 02a7744..c4636da 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -1768,14 +1768,6 @@ struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc,
 		}
 	}
 
-	/* set regulator constraints */
-	ret = set_machine_constraints(rdev, &init_data->constraints);
-	if (ret < 0) {
-		kfree(rdev);
-		rdev = ERR_PTR(ret);
-		goto out;
-	}
-
 	/* register with sysfs */
 	rdev->dev.class = &regulator_class;
 	rdev->dev.parent = dev;
@@ -1790,6 +1782,15 @@ struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc,
 
 	dev_set_drvdata(&rdev->dev, rdev);
 
+	/* set regulator constraints */
+	ret = set_machine_constraints(rdev, &init_data->constraints);
+	if (ret < 0) {
+		device_unregister(&rdev->dev);
+		kfree(rdev);
+		rdev = ERR_PTR(ret);
+		goto out;
+	}
+
 	/* set supply regulator if it exists */
 	if (init_data->supply_regulator_dev) {
 		ret = set_supply(rdev,
-- 
1.5.6.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