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-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1298381284-23317-1-git-send-email-eibach@gdsys.de>
Date:	Tue, 22 Feb 2011 14:28:04 +0100
From:	Dirk Eibach <eibach@...ys.de>
To:	linux-kernel@...r.kernel.org
Cc:	error27@...il.com, Dirk Eibach <eibach@...ys.de>
Subject: [PATCH v2] gpio: Fix wrong pointer type in pca953x

pca953x_get_alt_pdata() uses uint16_t* as result type for
of_get_property(), but numeric of values are u32.

Checking for negative values is bogus because of-property
values are unsigned by definition.

Signed-off-by: Dirk Eibach <eibach@...ys.de>
---
Changes since v1:
- removed bogus check for negative property values

 drivers/gpio/pca953x.c |   11 +++--------
 1 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/gpio/pca953x.c b/drivers/gpio/pca953x.c
index a261972..8acbfe9 100644
--- a/drivers/gpio/pca953x.c
+++ b/drivers/gpio/pca953x.c
@@ -448,7 +448,7 @@ pca953x_get_alt_pdata(struct i2c_client *client)
 {
 	struct pca953x_platform_data *pdata;
 	struct device_node *node;
-	const uint16_t *val;
+	const u32 *val;
 
 	node = client->dev.of_node;
 	if (node == NULL)
@@ -462,13 +462,8 @@ pca953x_get_alt_pdata(struct i2c_client *client)
 
 	pdata->gpio_base = -1;
 	val = of_get_property(node, "linux,gpio-base", NULL);
-	if (val) {
-		if (*val < 0)
-			dev_warn(&client->dev,
-				 "invalid gpio-base in device tree\n");
-		else
-			pdata->gpio_base = *val;
-	}
+	if (val)
+		pdata->gpio_base = *val;
 
 	val = of_get_property(node, "polarity", NULL);
 	if (val)
-- 
1.5.6.5

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