pinctrl: bcm2835: Fix memory leak in error path
Subsystems (4)
PATCH 1/1 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.
--- drivers/pinctrl/bcm/pinctrl-bcm2835.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/bcm/pinctrl-bcm2835.c +1 -1
@@ -795,7 +795,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; }
Signature · 1 line
1.7.9.5
PATCH 1/1 pinctrl: bcm2835: Fix memory leak in error path
Quoted 6 lines · Stefan Wahren
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 <[email protected]>Fixes e1b2dc70cd5b ("pinctrl: add bcm2835 driver")
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20151221/dfe30daf/attachment.sig>
PATCH 1/1 pinctrl: bcm2835: Fix memory leak in error path
In reply to Stefan WahrenQuoted 6 lines · Stefan Wahren
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 <[email protected]>Fixes e1b2dc70cd5b ("pinctrl: add bcm2835 driver")
Patch applied with Eric's Review tag.
Yours,
Linus Walleij