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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-id: <1334256332-29867-2-git-send-email-k.lewandowsk@samsung.com>
Date:	Thu, 12 Apr 2012 20:45:20 +0200
From:	Karol Lewandowski <k.lewandowsk@...sung.com>
To:	linux-samsung-soc@...r.kernel.org
Cc:	devicetree-discuss@...ts.ozlabs.org, thomas.abraham@...aro.org,
	m.szyprowski@...sung.com, kyungmin.park@...sung.com,
	linux-kernel@...r.kernel.org, olof@...om.net,
	kgene.kim@...sung.com, Karol Lewandowski <k.lewandowsk@...sung.com>
Subject: [PATCH 01/13] regulator: Fix DT node name checking in max8997-pmic

Avoid hard lockup when someone provides non-supported regulator
name.

Signed-off-by: Karol Lewandowski <k.lewandowsk@...sung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@...sung.com>
Cc: Thomas Abraham <thomas.abraham@...aro.org>
---
 drivers/regulator/max8997.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/regulator/max8997.c b/drivers/regulator/max8997.c
index dce8aaf..c20fd72 100644
--- a/drivers/regulator/max8997.c
+++ b/drivers/regulator/max8997.c
@@ -1011,6 +1011,13 @@ static int max8997_pmic_dt_parse_pdata(struct max8997_dev *iodev,
 		for (i = 0; i < ARRAY_SIZE(regulators); i++)
 			if (!of_node_cmp(reg_np->name, regulators[i].name))
 				break;
+
+		if (i == ARRAY_SIZE(regulators)) {
+			dev_warn(iodev->dev, "don't know how to configure regulator %s\n",
+				 reg_np->name);
+			continue;
+		}
+
 		rdata->id = i;
 		rdata->initdata = of_get_regulator_init_data(
 						iodev->dev, reg_np);
-- 
1.7.9.1

--
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