Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Dan Carpenter and committed by
Linus Walleij
6c3442b3 83d12f08

+1 -3
+1 -3
drivers/pinctrl/pinctrl-keembay.c
··· 1643 1643 new_funcs = devm_krealloc_array(kpc->dev, keembay_funcs, 1644 1644 kpc->nfuncs, sizeof(*new_funcs), 1645 1645 GFP_KERNEL); 1646 - if (!new_funcs) { 1647 - kfree(keembay_funcs); 1646 + if (!new_funcs) 1648 1647 return -ENOMEM; 1649 - } 1650 1648 1651 1649 return keembay_add_functions(kpc, new_funcs); 1652 1650 }