Re: [PATCH] MIPS: VPE: Fix a double free and a memory leak in 'release_vpe()'

From: Paul Burton
Date: Sat Feb 15 2020 - 17:56:21 EST


Hello,

Christophe JAILLET wrote:
> Pointer on the memory allocated by 'alloc_progmem()' is stored in
> 'v->load_addr'. So this is this memory that should be freed by
> 'release_progmem()'.
>
> 'release_progmem()' is only a call to 'kfree()'.
>
> With the current code, there is both a double free and a memory leak.
> Fix it by passing the correct pointer to 'release_progmem()'.

Applied to mips-fixes.

> commit bef8e2dfceed
> https://git.kernel.org/mips/c/bef8e2dfceed
>
> Fixes: e01402b115ccc ("More AP / SP bits for the 34K, the Malta bits and things. Still wants")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx>
> Signed-off-by: Paul Burton <paulburton@xxxxxxxxxx>

Thanks,
Paul

[ This message was auto-generated; if you believe anything is incorrect
then please email paulburton@xxxxxxxxxx to report it. ]