lkml.org 
[lkml]   [2022]   [Jun]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] mtd: rawnand: meson: Fix a potential double free issue
Date
On Fri, 2022-05-20 at 16:41:40 UTC, Christophe JAILLET wrote:
> When meson_nfc_nand_chip_cleanup() is called, it will call:
> meson_nfc_free_buffer(&meson_chip->nand);
> nand_cleanup(&meson_chip->nand);
>
> nand_cleanup() in turn will call nand_detach() which calls the
> .detach_chip() which is here meson_nand_detach_chip().
>
> meson_nand_detach_chip() already calls meson_nfc_free_buffer(), so we
> could double free some memory.
>
> Fix it by removing the unneeded explicit call to meson_nfc_free_buffer().
>
> Fixes: 8fae856c5350 ("mtd: rawnand: meson: add support for Amlogic NAND flash controller")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> Acked-by: Liang Yang <liang.yang@amlogic.com>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks.

Miquel

\
 
 \ /
  Last update: 2022-06-09 14:46    [W:0.042 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site