mtd: nand: don't free the global data too early
authorLiu Shuo <b35362@freescale.com>
Tue, 28 Jun 2011 01:50:51 +0000 (09:50 +0800)
committerArtem Bityutskiy <artem.bityutskiy@intel.com>
Sun, 11 Sep 2011 12:02:14 +0000 (15:02 +0300)
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@freescale.com>
Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
drivers/mtd/nand/fsl_elbc_nand.c

index 915b4a4c06c2646dd7795ae601292c19ffa3b532..3c2f03c55cac700ce638fbb61d1dec7438bce455 100644 (file)
@@ -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;
 }