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>
This commit is contained in:
Dan Carpenter 2025-09-04 21:58:54 +03:00 committed by Linus Walleij
parent 83d12f08dd
commit 6c3442b3b6
1 changed files with 1 additions and 3 deletions

View File

@ -1643,10 +1643,8 @@ static int keembay_build_functions(struct keembay_pinctrl *kpc)
new_funcs = devm_krealloc_array(kpc->dev, keembay_funcs,
kpc->nfuncs, sizeof(*new_funcs),
GFP_KERNEL);
if (!new_funcs) {
kfree(keembay_funcs);
if (!new_funcs)
return -ENOMEM;
}
return keembay_add_functions(kpc, new_funcs);
}