From: Dan Carpenter Date: Thu, 24 Dec 2015 07:25:32 +0000 (+0300) Subject: pinctrl: nsp-gpio: forever loop in nsp_gpio_get_strength() X-Git-Tag: v4.5-rc1~154^2~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ce6c1cd2c324c027de87d6c249298c9f93463ee8;p=platform%2Fkernel%2Flinux-exynos.git pinctrl: nsp-gpio: forever loop in nsp_gpio_get_strength() 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 Signed-off-by: Linus Walleij --- diff --git a/drivers/pinctrl/bcm/pinctrl-nsp-gpio.c b/drivers/pinctrl/bcm/pinctrl-nsp-gpio.c index 1f66761..725c36f 100644 --- a/drivers/pinctrl/bcm/pinctrl-nsp-gpio.c +++ b/drivers/pinctrl/bcm/pinctrl-nsp-gpio.c @@ -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;