Commit 53653c6b authored by Stefan Wahren's avatar Stefan Wahren Committed by Linus Walleij

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: default avatarStefan Wahren <stefan.wahren@i2se.com>
Fixes: e1b2dc70 ("pinctrl: add bcm2835 driver")
Reviewed-by: default avatarEric Anholt <eric@anholt.net>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 4fc8a4b2
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment