pinctrl: bcm2835: Fix memory leak in error path

In case of an invalid pin value bcm2835_pctl_dt_node_to_map()
would leak the pull configs of already assigned pins.
So avoid this by calling the free map function in error case.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Fixes: e1b2dc70cd ("pinctrl: add bcm2835 driver")
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
Stefan Wahren 2015-12-21 00:44:04 +00:00 committed by Linus Walleij
parent 4fc8a4b2a4
commit 53653c6b91
1 changed files with 1 additions and 1 deletions

View File

@ -794,7 +794,7 @@ static int bcm2835_pctl_dt_node_to_map(struct pinctrl_dev *pctldev,
return 0;
out:
kfree(maps);
bcm2835_pctl_dt_free_map(pctldev, maps, num_pins * maps_per_pin);
return err;
}