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 69dabd2..c51e4be 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;
        }