]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
spl: fit: do not check argument of free()
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Mon, 20 Apr 2020 10:44:01 +0000 (12:44 +0200)
committerTom Rini <trini@konsulko.com>
Fri, 24 Apr 2020 20:40:09 +0000 (16:40 -0400)
The free() function checks if its argument is NULL. It is superfluous to do
the same check on the calling side.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
common/spl/spl_fit.c

index 69dabd27f6d9d330ac7efdd7356945dce595dc55..c51e4beb1c0e2b8c24e265275d90bb20c7b7ec52 100644 (file)
@@ -425,8 +425,7 @@ static int spl_fit_append_fdt(struct spl_image_info *spl_image,
                        debug("%s: DT overlay %s applied\n", __func__,
                              fit_get_name(fit, node, NULL));
                }
-               if (tmpbuffer)
-                       free(tmpbuffer);
+               free(tmpbuffer);
                if (ret)
                        return ret;
        }