* [PATCH] mtd: rawnand: meson: Fix a potential double free issue
@ 2022-05-20 16:41 ` Christophe JAILLET
0 siblings, 0 replies; 12+ messages in thread
From: Christophe JAILLET @ 2022-05-20 16:41 UTC (permalink / raw)
To: Liang Yang, Miquel Raynal, Richard Weinberger,
Vignesh Raghavendra, Neil Armstrong, Kevin Hilman, Jerome Brunet,
Martin Blumenstingl, Yixun Lan, Jianxin Pan
Cc: linux-kernel, kernel-janitors, Christophe JAILLET, linux-mtd,
linux-arm-kernel, linux-amlogic
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>
---
This patch is speculative, so review with care.
---
drivers/mtd/nand/raw/meson_nand.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c
index ac3be92872d0..032180183339 100644
--- a/drivers/mtd/nand/raw/meson_nand.c
+++ b/drivers/mtd/nand/raw/meson_nand.c
@@ -1307,7 +1307,6 @@ static int meson_nfc_nand_chip_cleanup(struct meson_nfc *nfc)
if (ret)
return ret;
- meson_nfc_free_buffer(&meson_chip->nand);
nand_cleanup(&meson_chip->nand);
list_del(&meson_chip->node);
}
--
2.34.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH] mtd: rawnand: meson: Fix a potential double free issue
@ 2022-05-20 16:41 ` Christophe JAILLET
0 siblings, 0 replies; 12+ messages in thread
From: Christophe JAILLET @ 2022-05-20 16:41 UTC (permalink / raw)
To: Liang Yang, Miquel Raynal, Richard Weinberger,
Vignesh Raghavendra, Neil Armstrong, Kevin Hilman, Jerome Brunet,
Martin Blumenstingl, Yixun Lan, Jianxin Pan
Cc: linux-kernel, kernel-janitors, Christophe JAILLET, linux-mtd,
linux-arm-kernel, linux-amlogic
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>
---
This patch is speculative, so review with care.
---
drivers/mtd/nand/raw/meson_nand.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c
index ac3be92872d0..032180183339 100644
--- a/drivers/mtd/nand/raw/meson_nand.c
+++ b/drivers/mtd/nand/raw/meson_nand.c
@@ -1307,7 +1307,6 @@ static int meson_nfc_nand_chip_cleanup(struct meson_nfc *nfc)
if (ret)
return ret;
- meson_nfc_free_buffer(&meson_chip->nand);
nand_cleanup(&meson_chip->nand);
list_del(&meson_chip->node);
}
--
2.34.1
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH] mtd: rawnand: meson: Fix a potential double free issue
@ 2022-05-20 16:41 ` Christophe JAILLET
0 siblings, 0 replies; 12+ messages in thread
From: Christophe JAILLET @ 2022-05-20 16:41 UTC (permalink / raw)
To: Liang Yang, Miquel Raynal, Richard Weinberger,
Vignesh Raghavendra, Neil Armstrong, Kevin Hilman, Jerome Brunet,
Martin Blumenstingl, Yixun Lan, Jianxin Pan
Cc: linux-kernel, kernel-janitors, Christophe JAILLET, linux-mtd,
linux-arm-kernel, linux-amlogic
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>
---
This patch is speculative, so review with care.
---
drivers/mtd/nand/raw/meson_nand.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c
index ac3be92872d0..032180183339 100644
--- a/drivers/mtd/nand/raw/meson_nand.c
+++ b/drivers/mtd/nand/raw/meson_nand.c
@@ -1307,7 +1307,6 @@ static int meson_nfc_nand_chip_cleanup(struct meson_nfc *nfc)
if (ret)
return ret;
- meson_nfc_free_buffer(&meson_chip->nand);
nand_cleanup(&meson_chip->nand);
list_del(&meson_chip->node);
}
--
2.34.1
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH] mtd: rawnand: meson: Fix a potential double free issue
@ 2022-05-20 16:41 ` Christophe JAILLET
0 siblings, 0 replies; 12+ messages in thread
From: Christophe JAILLET @ 2022-05-20 16:41 UTC (permalink / raw)
To: Liang Yang, Miquel Raynal, Richard Weinberger,
Vignesh Raghavendra, Neil Armstrong, Kevin Hilman, Jerome Brunet,
Martin Blumenstingl, Yixun Lan, Jianxin Pan
Cc: linux-kernel, kernel-janitors, Christophe JAILLET, linux-mtd,
linux-arm-kernel, linux-amlogic
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>
---
This patch is speculative, so review with care.
---
drivers/mtd/nand/raw/meson_nand.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c
index ac3be92872d0..032180183339 100644
--- a/drivers/mtd/nand/raw/meson_nand.c
+++ b/drivers/mtd/nand/raw/meson_nand.c
@@ -1307,7 +1307,6 @@ static int meson_nfc_nand_chip_cleanup(struct meson_nfc *nfc)
if (ret)
return ret;
- meson_nfc_free_buffer(&meson_chip->nand);
nand_cleanup(&meson_chip->nand);
list_del(&meson_chip->node);
}
--
2.34.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH] mtd: rawnand: meson: Fix a potential double free issue
2022-05-20 16:41 ` Christophe JAILLET
(?)
(?)
@ 2022-05-26 5:34 ` Liang Yang
-1 siblings, 0 replies; 12+ messages in thread
From: Liang Yang @ 2022-05-26 5:34 UTC (permalink / raw)
To: Christophe JAILLET, Miquel Raynal, Richard Weinberger,
Vignesh Raghavendra, Neil Armstrong, Kevin Hilman, Jerome Brunet,
Martin Blumenstingl, Yixun Lan, Jianxin Pan
Cc: linux-kernel, kernel-janitors, linux-mtd, linux-arm-kernel,
linux-amlogic
Hi Christophe,
On 2022/5/21 0:41, Christophe JAILLET wrote:
> [ EXTERNAL EMAIL ]
>
> 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>
> ---
> This patch is speculative, so review with care.
> ---
> drivers/mtd/nand/raw/meson_nand.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c
> index ac3be92872d0..032180183339 100644
> --- a/drivers/mtd/nand/raw/meson_nand.c
> +++ b/drivers/mtd/nand/raw/meson_nand.c
> @@ -1307,7 +1307,6 @@ static int meson_nfc_nand_chip_cleanup(struct meson_nfc *nfc)
> if (ret)
> return ret;
>
> - meson_nfc_free_buffer(&meson_chip->nand);
> nand_cleanup(&meson_chip->nand);
> list_del(&meson_chip->node);
> }
Acked-by: Liang Yang <liang.yang@amlogic.com>
Thanks,
Liang
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] mtd: rawnand: meson: Fix a potential double free issue
@ 2022-05-26 5:34 ` Liang Yang
0 siblings, 0 replies; 12+ messages in thread
From: Liang Yang @ 2022-05-26 5:34 UTC (permalink / raw)
To: Christophe JAILLET, Miquel Raynal, Richard Weinberger,
Vignesh Raghavendra, Neil Armstrong, Kevin Hilman, Jerome Brunet,
Martin Blumenstingl, Yixun Lan, Jianxin Pan
Cc: linux-kernel, kernel-janitors, linux-mtd, linux-arm-kernel,
linux-amlogic
Hi Christophe,
On 2022/5/21 0:41, Christophe JAILLET wrote:
> [ EXTERNAL EMAIL ]
>
> 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>
> ---
> This patch is speculative, so review with care.
> ---
> drivers/mtd/nand/raw/meson_nand.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c
> index ac3be92872d0..032180183339 100644
> --- a/drivers/mtd/nand/raw/meson_nand.c
> +++ b/drivers/mtd/nand/raw/meson_nand.c
> @@ -1307,7 +1307,6 @@ static int meson_nfc_nand_chip_cleanup(struct meson_nfc *nfc)
> if (ret)
> return ret;
>
> - meson_nfc_free_buffer(&meson_chip->nand);
> nand_cleanup(&meson_chip->nand);
> list_del(&meson_chip->node);
> }
Acked-by: Liang Yang <liang.yang@amlogic.com>
Thanks,
Liang
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] mtd: rawnand: meson: Fix a potential double free issue
@ 2022-05-26 5:34 ` Liang Yang
0 siblings, 0 replies; 12+ messages in thread
From: Liang Yang @ 2022-05-26 5:34 UTC (permalink / raw)
To: Christophe JAILLET, Miquel Raynal, Richard Weinberger,
Vignesh Raghavendra, Neil Armstrong, Kevin Hilman, Jerome Brunet,
Martin Blumenstingl, Yixun Lan, Jianxin Pan
Cc: linux-kernel, kernel-janitors, linux-mtd, linux-arm-kernel,
linux-amlogic
Hi Christophe,
On 2022/5/21 0:41, Christophe JAILLET wrote:
> [ EXTERNAL EMAIL ]
>
> 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>
> ---
> This patch is speculative, so review with care.
> ---
> drivers/mtd/nand/raw/meson_nand.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c
> index ac3be92872d0..032180183339 100644
> --- a/drivers/mtd/nand/raw/meson_nand.c
> +++ b/drivers/mtd/nand/raw/meson_nand.c
> @@ -1307,7 +1307,6 @@ static int meson_nfc_nand_chip_cleanup(struct meson_nfc *nfc)
> if (ret)
> return ret;
>
> - meson_nfc_free_buffer(&meson_chip->nand);
> nand_cleanup(&meson_chip->nand);
> list_del(&meson_chip->node);
> }
Acked-by: Liang Yang <liang.yang@amlogic.com>
Thanks,
Liang
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] mtd: rawnand: meson: Fix a potential double free issue
@ 2022-05-26 5:34 ` Liang Yang
0 siblings, 0 replies; 12+ messages in thread
From: Liang Yang @ 2022-05-26 5:34 UTC (permalink / raw)
To: Christophe JAILLET, Miquel Raynal, Richard Weinberger,
Vignesh Raghavendra, Neil Armstrong, Kevin Hilman, Jerome Brunet,
Martin Blumenstingl, Yixun Lan, Jianxin Pan
Cc: linux-kernel, kernel-janitors, linux-mtd, linux-arm-kernel,
linux-amlogic
Hi Christophe,
On 2022/5/21 0:41, Christophe JAILLET wrote:
> [ EXTERNAL EMAIL ]
>
> 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>
> ---
> This patch is speculative, so review with care.
> ---
> drivers/mtd/nand/raw/meson_nand.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c
> index ac3be92872d0..032180183339 100644
> --- a/drivers/mtd/nand/raw/meson_nand.c
> +++ b/drivers/mtd/nand/raw/meson_nand.c
> @@ -1307,7 +1307,6 @@ static int meson_nfc_nand_chip_cleanup(struct meson_nfc *nfc)
> if (ret)
> return ret;
>
> - meson_nfc_free_buffer(&meson_chip->nand);
> nand_cleanup(&meson_chip->nand);
> list_del(&meson_chip->node);
> }
Acked-by: Liang Yang <liang.yang@amlogic.com>
Thanks,
Liang
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] mtd: rawnand: meson: Fix a potential double free issue
2022-05-20 16:41 ` Christophe JAILLET
(?)
(?)
@ 2022-06-09 12:44 ` Miquel Raynal
-1 siblings, 0 replies; 12+ messages in thread
From: Miquel Raynal @ 2022-06-09 12:44 UTC (permalink / raw)
To: Christophe JAILLET, Liang Yang, Miquel Raynal,
Richard Weinberger, Vignesh Raghavendra, Neil Armstrong,
Kevin Hilman, Jerome Brunet, Martin Blumenstingl, Yixun Lan,
Jianxin Pan
Cc: linux-kernel, kernel-janitors, linux-mtd, linux-arm-kernel,
linux-amlogic
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
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] mtd: rawnand: meson: Fix a potential double free issue
@ 2022-06-09 12:44 ` Miquel Raynal
0 siblings, 0 replies; 12+ messages in thread
From: Miquel Raynal @ 2022-06-09 12:44 UTC (permalink / raw)
To: Christophe JAILLET, Liang Yang, Miquel Raynal,
Richard Weinberger, Vignesh Raghavendra, Neil Armstrong,
Kevin Hilman, Jerome Brunet, Martin Blumenstingl, Yixun Lan,
Jianxin Pan
Cc: linux-kernel, kernel-janitors, linux-mtd, linux-arm-kernel,
linux-amlogic
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
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] mtd: rawnand: meson: Fix a potential double free issue
@ 2022-06-09 12:44 ` Miquel Raynal
0 siblings, 0 replies; 12+ messages in thread
From: Miquel Raynal @ 2022-06-09 12:44 UTC (permalink / raw)
To: Christophe JAILLET, Liang Yang, Miquel Raynal,
Richard Weinberger, Vignesh Raghavendra, Neil Armstrong,
Kevin Hilman, Jerome Brunet, Martin Blumenstingl, Yixun Lan,
Jianxin Pan
Cc: linux-kernel, kernel-janitors, linux-mtd, linux-arm-kernel,
linux-amlogic
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
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] mtd: rawnand: meson: Fix a potential double free issue
@ 2022-06-09 12:44 ` Miquel Raynal
0 siblings, 0 replies; 12+ messages in thread
From: Miquel Raynal @ 2022-06-09 12:44 UTC (permalink / raw)
To: Christophe JAILLET, Liang Yang, Miquel Raynal,
Richard Weinberger, Vignesh Raghavendra, Neil Armstrong,
Kevin Hilman, Jerome Brunet, Martin Blumenstingl, Yixun Lan,
Jianxin Pan
Cc: linux-kernel, kernel-janitors, linux-mtd, linux-arm-kernel,
linux-amlogic
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
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2022-06-09 12:45 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-20 16:41 [PATCH] mtd: rawnand: meson: Fix a potential double free issue Christophe JAILLET
2022-05-20 16:41 ` Christophe JAILLET
2022-05-20 16:41 ` Christophe JAILLET
2022-05-20 16:41 ` Christophe JAILLET
2022-05-26 5:34 ` Liang Yang
2022-05-26 5:34 ` Liang Yang
2022-05-26 5:34 ` Liang Yang
2022-05-26 5:34 ` Liang Yang
2022-06-09 12:44 ` Miquel Raynal
2022-06-09 12:44 ` Miquel Raynal
2022-06-09 12:44 ` Miquel Raynal
2022-06-09 12:44 ` Miquel Raynal
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.