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: <1337285060-31919-3-git-send-email-grant.likely@secretlab.ca>
Date:	Thu, 17 May 2012 14:04:20 -0600
From:	Grant Likely <grant.likely@...retlab.ca>
To:	linux-kernel@...r.kernel.org
Cc:	Grant Likely <grant.likely@...retlab.ca>,
	Roland Stigge <stigge@...com.de>
Subject: [PATCH 3/3] gpio/lpc32xx: Fixup of_xlate for core changes

Hi Roland,

I've reworked the of_xlate code for gpios in a way that I'm happier with, but it is untested.  Can you try it out with this patch to your code and make sure it works properly for you?  You can roll this change into your patch if it works.

Signed-off-by: Grant Likely <grant.likely@...retlab.ca>
Cc: Roland Stigge <stigge@...com.de>
---
 drivers/gpio/gpio-lpc32xx.c |   13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/drivers/gpio/gpio-lpc32xx.c b/drivers/gpio/gpio-lpc32xx.c
index d42bf6c..6ea7b38 100644
--- a/drivers/gpio/gpio-lpc32xx.c
+++ b/drivers/gpio/gpio-lpc32xx.c
@@ -464,18 +464,15 @@ void __init lpc32xx_gpio_init(void)
 {
 }
 
-static int lpc32xx_of_xlate(struct gpio_chip **gc,
+static int lpc32xx_of_xlate(struct gpio_chip *gc,
 			    const struct of_phandle_args *gpiospec, u32 *flags)
 {
-	u32 bank;
-	if (WARN_ON(gpiospec->args_count < 3))
+	/* Is this the correct bank? */
+	u32 bank = gpiospec->args[0];
+	if ((bank > ARRAY_SIZE(lpc32xx_gpiochip) ||
+	    (gc != &lpc32xx_gpiochip[bank].chip))
 		return -EINVAL;
 
-	bank = gpiospec->args[0];
-	if (WARN_ON(bank > 5))
-		return -EINVAL;
-
-	*gc = &lpc32xx_gpiochip[bank].chip;
 	if (flags)
 		*flags = gpiospec->args[2];
 	return gpiospec->args[1];
-- 
1.7.9.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