mtd: nand: don't free the global data too early

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Mon Nov 7 11:59:25 EST 2011


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=57b078a09bf0ab3f0babcfe6ecb2ac226d9178be
Commit:     57b078a09bf0ab3f0babcfe6ecb2ac226d9178be
Parent:     b4ca74738ab6c9ed8190b06cd7bf785dc98c640e
Author:     Liu Shuo <b35362 at freescale.com>
AuthorDate: Tue Jun 28 09:50:51 2011 +0800
Committer:  Artem Bityutskiy <artem.bityutskiy at intel.com>
CommitDate: Sun Sep 11 15:02:14 2011 +0300

    mtd: nand: don't free the global data too early
    
    The global data fsl_lbc_ctrl_dev->nand don't have to be freed in
    fsl_elbc_chip_remove(). The right place to do that is in fsl_elbc_nand_remove()
    if elbc_fcm_ctrl->counter is zero.
    
    Signed-off-by: Liu Shuo <b35362 at freescale.com>
    Signed-off-by: Artem Bityutskiy <dedekind1 at gmail.com>
---
 drivers/mtd/nand/fsl_elbc_nand.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/nand/fsl_elbc_nand.c b/drivers/mtd/nand/fsl_elbc_nand.c
index 915b4a4..3c2f03c 100644
--- a/drivers/mtd/nand/fsl_elbc_nand.c
+++ b/drivers/mtd/nand/fsl_elbc_nand.c
@@ -829,7 +829,6 @@ static int fsl_elbc_chip_remove(struct fsl_elbc_mtd *priv)
 
 	elbc_fcm_ctrl->chips[priv->bank] = NULL;
 	kfree(priv);
-	kfree(elbc_fcm_ctrl);
 	return 0;
 }
 



More information about the linux-mtd-cvs mailing list