gpio: brcmstb: missing error code
PATCH 1/1 gpio: brcmstb: missing error code
We should set the error code before returning here. Otherwise "err" could be uninitialized or zero.
Signed-off-by Dan Carpenter <[email protected]>
drivers/gpio/gpio-brcmstb.c +1 -0
@@ -461,6 +461,7 @@ static int brcmstb_gpio_probe(struct platform_device *pdev) bank->id = num_banks;if (bank_width <=0 || bank_width >MAX_GPIO_PER_BANK ) {dev_err (dev,"Invalid bank width %d\n" , bank_width); + err = -EINVAL ; goto fail; }else { bank->width = bank_width;
Quoted 4 lines · Dan Carpenter
We should set the error code before returning here. Otherwise "err" could be uninitialized or zero.
Signed-off-by Dan Carpenter <[email protected]>
Axel just sent an identical patch which Linus picked already:
http://www.spinics.net/lists/linux-gpio/msg13728.html
Thanks Dan!
Signature · 1 line
Florian
Quoted 9 lines · Florian Fainelli
Quoted 4 lines · Dan Carpenter
We should set the error code before returning here. Otherwise "err" could be uninitialized or zero.
Signed-off-by Dan Carpenter <[email protected]>Axel just sent an identical patch which Linus picked already:
Heh. Weird timing. That bug has been there for 11 months...
regards,
dan carpenter