From: Brian Norris <computersforpeace@gmail.com> Date: Fri, 29 Mar 2013 04:28:56 +0000 (-0700) Subject: mtd: fsl_ifc_nand: remove incorrect kfree() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b966a40a3854e1263b3528ef95bc9e6017e8e515;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com> --- diff --git a/drivers/mtd/nand/fsl_ifc_nand.c b/drivers/mtd/nand/fsl_ifc_nand.c index f1f7f12ab501..180bfa798e13 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; }