diff mbox

pinctrl: nsp-gpio: forever loop in nsp_gpio_get_strength()

Message ID 20151224072532.GC29642@mwanda
State New
Headers show

Commit Message

Dan Carpenter Dec. 24, 2015, 7:25 a.m. UTC
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>

--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Linus Walleij Dec. 24, 2015, 9:01 a.m. UTC | #1
On Thu, Dec 24, 2015 at 8:25 AM, Dan Carpenter <dan.carpenter@oracle.com> wrote:

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

Merry Christmas!
Patch applied.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/pinctrl/bcm/pinctrl-nsp-gpio.c b/drivers/pinctrl/bcm/pinctrl-nsp-gpio.c
index 34648f6..ac7b010 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;