Re: [PATCH] pinctrl: sunxi: Fix a memory leak in 'sunxi_pinctrl_build_state()'

From: Linus Walleij
Date: Tue Oct 16 2018 - 04:04:39 EST


On Tue, Oct 16, 2018 at 8:22 AM Christophe JAILLET
<christophe.jaillet@xxxxxxxxxx> wrote:

> 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@xxxxxxxxxx>

Patch applied with Maxime's ACK.

Yours,
Linus Walleij