Skip to contentSkip to conversation

gpio: brcmstb: missing error code

PATCH In review Dan Carpenter 2 participants 3 messages Apr 15, 2016

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpio: brcmstb: missing error code

We should set the error code before returning here. Otherwise "err" could be uninitialized or zero.

drivers/gpio/gpio-brcmstb.c +1 -0
index 42d51c5..e648914 100644
@@ -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;