gpio: brcmstb: Return proper error if bank width is invalid
authorAxel Lin <axel.lin@ingics.com>
Sun, 10 Apr 2016 10:15:15 +0000 (18:15 +0800)
committerLinus Walleij <linus.walleij@linaro.org>
Fri, 15 Apr 2016 08:09:48 +0000 (10:09 +0200)
Return proper error in brcmstb_gpio_probe if bank width is invalid.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Gregory Fong <gregory.0xf0@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-brcmstb.c

index 42d51c59ed5024b861936f14235143bdc0aa30a2..e6489143721a926f5c85d5d416349f35691f0c5d 100644 (file)
@@ -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;