From 35b3fc8876ef927885f68e481efc049285d07e53 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Sun, 10 Apr 2016 18:15:15 +0800 Subject: [PATCH] gpio: brcmstb: Return proper error if bank width is invalid Return proper error in brcmstb_gpio_probe if bank width is invalid. Signed-off-by: Axel Lin Acked-by: Gregory Fong Signed-off-by: Linus Walleij --- drivers/gpio/gpio-brcmstb.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpio/gpio-brcmstb.c b/drivers/gpio/gpio-brcmstb.c index 42d51c59ed50..e6489143721a 100644 --- a/drivers/gpio/gpio-brcmstb.c +++ b/drivers/gpio/gpio-brcmstb.c @@ -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; -- 2.20.1