Skip to contentSkip to conversation

mtd: maps: Remove redundant NULL check before kfree

PATCH Applied Syam Sidhardhan 2 participants 2 messages Feb 26, 2013 – Mar 8, 2013 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mtd: maps: Remove redundant NULL check before kfree

kfree on NULL pointer is a no-op.

---
 drivers/mtd/maps/ck804xrom.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/mtd/maps/ck804xrom.c +1 -2
index 586a1c7..0455166 100644
@@ -308,8 +308,7 @@ static int ck804xrom_init_one(struct pci_dev *pdev,
 
  out:
 	/* Free any left over map structures */
-	if (map)
-		kfree(map);
+	kfree(map);
 
 	/* See if I have any map structures */
 	if (list_empty(&window->maps)) {
Signature · 1 line
1.7.9.5