mirror of https://github.com/torvalds/linux.git
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:
parent
83d12f08dd
commit
6c3442b3b6
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue