Commit 6c3442b3 authored by Dan Carpenter's avatar Dan Carpenter Committed by Linus Walleij
Browse files

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: default avatarDan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: default avatarBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 83d12f08
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -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);
}