]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
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 315f95cce8291e81606fa54042837568fffa89c6..29f83b65542968a58e7e46c142199143fef48b95 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;
 }