mtd: rawnand: free the nand_device object

This patch releases the resources allocated in nanddev_init function.

Fixes: a7ab085d7c ("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
This commit is contained in:
Christophe Kerello 2020-01-23 09:22:48 +01:00 committed by Miquel Raynal
parent 43d8b63623
commit 009264605c
1 changed files with 2 additions and 0 deletions

View File

@ -5912,6 +5912,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);