mtd: fsl_ifc_nand: remove incorrect kfree()

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Mon Aug 5 16:59:01 EDT 2013


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=b966a40a3854e1263b3528ef95bc9e6017e8e515
Commit:     b966a40a3854e1263b3528ef95bc9e6017e8e515
Parent:     bddcb5e7caa72890fcd1d6ee7803452f2295a407
Author:     Brian Norris <computersforpeace at gmail.com>
AuthorDate: Thu Mar 28 21:28:56 2013 -0700
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Mon Aug 5 18:58:08 2013 +0100

    mtd: fsl_ifc_nand: remove incorrect kfree()
    
    The struct fsl_ifc_mtd is allocated with devm_kzalloc, so its memory
    is "managed" automatically by the kernel. That is, we do not need to
    free it explicitly; it will be freed when the device is removed. And we
    *certainly* shouldn't free it with a regular kfree().
    
    Signed-off-by: Brian Norris <computersforpeace at gmail.com>
    Signed-off-by: Artem Bityutskiy <artem.bityutskiy at linux.intel.com>
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
 drivers/mtd/nand/fsl_ifc_nand.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/mtd/nand/fsl_ifc_nand.c b/drivers/mtd/nand/fsl_ifc_nand.c
index f1f7f12..180bfa7 100644
--- a/drivers/mtd/nand/fsl_ifc_nand.c
+++ b/drivers/mtd/nand/fsl_ifc_nand.c
@@ -908,7 +908,6 @@ static int fsl_ifc_chip_remove(struct fsl_ifc_mtd *priv)
 
 	ifc_nand_ctrl->chips[priv->bank] = NULL;
 	dev_set_drvdata(priv->dev, NULL);
-	kfree(priv);
 
 	return 0;
 }



More information about the linux-mtd-cvs mailing list