]> git.sur5r.net Git - u-boot/commitdiff
ubifs: no NULL check needed before free
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Wed, 8 Nov 2017 21:28:47 +0000 (22:28 +0100)
committerHeiko Schocher <hs@denx.de>
Mon, 20 Nov 2017 09:13:33 +0000 (10:13 +0100)
kfree() calls free.
free() checks if the parameter is NULL.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
fs/ubifs/ubifs.c

index 8f1c9d167d741fe0a1b65475de10713785d29e1d..4465523d5fbe49ef9beb693ae909e7cdd86fdaa0 100644 (file)
@@ -462,14 +462,10 @@ out:
                dbg_gen("cannot find next direntry, error %d", err);
 
 out_free:
-       if (file->private_data)
-               kfree(file->private_data);
-       if (file)
-               free(file);
-       if (dentry)
-               free(dentry);
-       if (dir)
-               free(dir);
+       kfree(file->private_data);
+       free(file);
+       free(dentry);
+       free(dir);
 
        return ret;
 }