summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Kerello <christophe.kerello@st.com>2020-01-23 11:22:48 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-04-23 11:38:25 +0300
commit09766d7091c5193df8fd9852fe836fc67ef0d554 (patch)
tree3d5d6078a6cf64626894b9eb68f61916fa80859d
parentd940415b0733791b986444594299c3cc4545f2c8 (diff)
downloadlinux-09766d7091c5193df8fd9852fe836fc67ef0d554.tar.xz
mtd: rawnand: free the nand_device object
commit 009264605cdf1b12962c3a46f75818d05452e890 upstream. This patch releases the resources allocated in nanddev_init function. Fixes: a7ab085d7c16 ("mtd: rawnand: Initialize the nand_device object") Signed-off-by: Christophe Kerello <christophe.kerello@st.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/1579767768-32295-1-git-send-email-christophe.kerello@st.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/mtd/nand/raw/nand_base.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c
index f64e3b6605c6..47c63968fa45 100644
--- a/drivers/mtd/nand/raw/nand_base.c
+++ b/drivers/mtd/nand/raw/nand_base.c
@@ -5907,6 +5907,8 @@ void nand_cleanup(struct nand_chip *chip)
chip->ecc.algo == NAND_ECC_BCH)
nand_bch_free((struct nand_bch_control *)chip->ecc.priv);
+ nanddev_cleanup(&chip->base);
+
/* Free bad block table memory */
kfree(chip->bbt);
kfree(chip->data_buf);