From: Axel Lin Date: Sun, 10 Apr 2016 10:15:15 +0000 (+0800) Subject: gpio: brcmstb: Return proper error if bank width is invalid X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=35b3fc8876ef927885f68e481efc049285d07e53;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 --- 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;