gpio: fix memory leak in error path
Signed-off-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
parent
0c8aab8e65
commit
61c6375d55
@ -1354,8 +1354,10 @@ int gpiochip_add_pingroup_range(struct gpio_chip *chip,
|
||||
ret = pinctrl_get_group_pins(pctldev, pin_group,
|
||||
&pin_range->range.pins,
|
||||
&pin_range->range.npins);
|
||||
if (ret < 0)
|
||||
if (ret < 0) {
|
||||
kfree(pin_range);
|
||||
return ret;
|
||||
}
|
||||
|
||||
pinctrl_add_gpio_range(pctldev, &pin_range->range);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user