mmc: do not check argument of free() beforehand
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Tue, 29 Sep 2020 19:48:08 +0000 (21:48 +0200)
committerPeng Fan <peng.fan@nxp.com>
Mon, 12 Oct 2020 07:53:20 +0000 (15:53 +0800)
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

index 315f95c..29f83b6 100644 (file)
@@ -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;
 }