Skip to content

Commit 6c3442b

Browse files
Dan CarpenterLinus Walleij
authored andcommitted
pinctrl: keembay: fix double free in keembay_build_functions()
This kfree() was accidentally left over when we converted to devm_ and it would lead to a double free. Delete it. Fixes: 995bc9f4826e ("pinctrl: keembay: release allocated memory in detach path") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
1 parent 83d12f0 commit 6c3442b

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

drivers/pinctrl/pinctrl-keembay.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1643,10 +1643,8 @@ static int keembay_build_functions(struct keembay_pinctrl *kpc)
16431643
new_funcs = devm_krealloc_array(kpc->dev, keembay_funcs,
16441644
kpc->nfuncs, sizeof(*new_funcs),
16451645
GFP_KERNEL);
1646-
if (!new_funcs) {
1647-
kfree(keembay_funcs);
1646+
if (!new_funcs)
16481647
return -ENOMEM;
1649-
}
16501648

16511649
return keembay_add_functions(kpc, new_funcs);
16521650
}

0 commit comments

Comments
 (0)