diff mbox series

[1/1] mmc: do not check argument of free() beforehand

Message ID 20200929194808.58522-1-xypron.glpk@gmx.de
State New
Delegated to: Peng Fan
Headers show
Series [1/1] mmc: do not check argument of free() beforehand | expand

Commit Message

Heinrich Schuchardt Sept. 29, 2020, 7:48 p.m. UTC
free() checks if its argument in NULL. No need to check it twice.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 drivers/mmc/sh_sdhi.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--
2.28.0
diff mbox series

Patch

diff --git a/drivers/mmc/sh_sdhi.c b/drivers/mmc/sh_sdhi.c
index 315f95cce8..29f83b6554 100644
--- a/drivers/mmc/sh_sdhi.c
+++ b/drivers/mmc/sh_sdhi.c
@@ -784,8 +784,7 @@  int sh_sdhi_init(unsigned long addr, int ch, unsigned long quirks)

 	return ret;
 error:
-	if (host)
-		free(host);
+	free(host);
 	return ret;
 }