]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commit
pinctrl: sunxi: Fix a memory leak in 'sunxi_pinctrl_build_state()'
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Tue, 16 Oct 2018 06:22:28 +0000 (08:22 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Tue, 16 Oct 2018 08:03:48 +0000 (10:03 +0200)
commita93a676b079144009f55fff2ab0e34c3b7258c8a
tree76a77125d9f31bcdf15b581d38aacb55655309f2
parentee8edbf8ca6bfde89bb2a9e6efe261b9ea622ee7
pinctrl: sunxi: Fix a memory leak in 'sunxi_pinctrl_build_state()'

If 'krealloc()' fails, 'pctl->functions' is set to NULL.
We should instead use a temp variable in order to be able to free the
previously allocated memeory, in case of OOM.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/sunxi/pinctrl-sunxi.c