pinctrl: nsp-gpio: forever loop in nsp_gpio_get_strength()
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 24 Dec 2015 07:25:32 +0000 (10:25 +0300)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 24 Dec 2015 08:58:05 +0000 (09:58 +0100)
There is a signedness bug here so the loop will never exit.

Fixes: 8bfcbbbcabe0 ('pinctrl: nsp: add gpio-a driver support for Broadcom NSP SoC')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/bcm/pinctrl-nsp-gpio.c

index 1f66761c1a25d1b9296050e9100e18028dd4b5c5..725c36f917f9cbcd93ae04e6822070340ea399f8 100644 (file)
@@ -439,9 +439,10 @@ static int nsp_gpio_set_strength(struct nsp_gpio *chip, unsigned gpio,
 static int nsp_gpio_get_strength(struct nsp_gpio *chip, unsigned gpio,
                                 u16 *strength)
 {
-       unsigned int i, offset, shift;
+       unsigned int offset, shift;
        u32 val;
        unsigned long flags;
+       int i;
 
        offset = NSP_GPIO_DRV_CTRL;
        shift = gpio;