mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 22:21:40 +00:00
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 <axel.lin@ingics.com> Acked-by: Gregory Fong <gregory.0xf0@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
parent
c31a571d43
commit
35b3fc8876
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user