Skip to contentSkip to conversation

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

PATCH In review Dan Carpenter 2 participants 2 messages Dec 24, 2015

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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')
drivers/pinctrl/bcm/pinctrl-nsp-gpio.c +2 -1
index 34648f6..ac7b010 100644
@@ -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;
#1 lore raw
Quoted 4 lines · Dan Carpenter

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

Merry Christmas!
Patch applied.

Yours,
Linus Walleij