diff mbox series

[4/5] mtd: pxa3xx_nand: remove dead code

Message ID 41334f90751bbeaf38525f66e39057e1b77b7e97.1600166553.git.baruch@tkos.co.il
State Superseded
Delegated to: Stefan Roese
Headers show
Series mtd: pxa3xx_nand: add support for Armada 8k | expand

Commit Message

Baruch Siach Sept. 15, 2020, 11:07 a.m. UTC
The kfree() call is unreachable, and is not needed. Remove this call and
the fail_disable_clk label.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
---
 drivers/mtd/nand/raw/pxa3xx_nand.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)
diff mbox series

Patch

diff --git a/drivers/mtd/nand/raw/pxa3xx_nand.c b/drivers/mtd/nand/raw/pxa3xx_nand.c
index d455201b91a3..54ba65fa8202 100644
--- a/drivers/mtd/nand/raw/pxa3xx_nand.c
+++ b/drivers/mtd/nand/raw/pxa3xx_nand.c
@@ -1769,7 +1769,7 @@  static int alloc_nand_resource(struct pxa3xx_nand_info *info)
 	struct pxa3xx_nand_host *host;
 	struct nand_chip *chip = NULL;
 	struct mtd_info *mtd;
-	int ret, cs;
+	int cs;
 
 	pdata = info->pdata;
 	if (pdata->num_cs <= 0)
@@ -1805,19 +1805,13 @@  static int alloc_nand_resource(struct pxa3xx_nand_info *info)
 	/* Allocate a buffer to allow flash detection */
 	info->buf_size = INIT_BUFFER_SIZE;
 	info->data_buff = kmalloc(info->buf_size, GFP_KERNEL);
-	if (info->data_buff == NULL) {
-		ret = -ENOMEM;
-		goto fail_disable_clk;
-	}
+	if (info->data_buff == NULL)
+		return -ENOMEM;
 
 	/* initialize all interrupts to be disabled */
 	disable_int(info, NDSR_MASK);
 
 	return 0;
-
-	kfree(info->data_buff);
-fail_disable_clk:
-	return ret;
 }
 
 static int pxa3xx_nand_probe_dt(struct udevice *dev, struct pxa3xx_nand_info *info)