mtd: omap2: fix omap_nand_remove segfault
[firefly-linux-kernel-4.4.55.git] / drivers / mtd / nand / omap2.c
index f47c422c7dfd4eb7ccaa65b613cccca31c86a62b..e604a458c8a6dc5e0d123caa520b714545ab00e3 100644 (file)
@@ -1364,7 +1364,7 @@ static int omap_nand_remove(struct platform_device *pdev)
        /* Release NAND device, its internal structures and partitions */
        nand_release(&info->mtd);
        iounmap(info->nand.IO_ADDR_R);
-       kfree(&info->mtd);
+       kfree(info);
        return 0;
 }