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

Heinrich Schuchardt xypron.glpk at gmx.de
Tue Sep 29 21:48:08 CEST 2020


free() checks if its argument in NULL. No need to check it twice.

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

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;
 }

--
2.28.0



More information about the U-Boot mailing list