From: Heinrich Schuchardt Date: Wed, 8 Nov 2017 21:28:47 +0000 (+0100) Subject: ubifs: no NULL check needed before free X-Git-Tag: v2018.01-rc1~87^2~1 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=4b29975fd0f25256d8e643076a2c4c5f9de00f8f;p=u-boot ubifs: no NULL check needed before free kfree() calls free. free() checks if the parameter is NULL. Signed-off-by: Heinrich Schuchardt --- diff --git a/fs/ubifs/ubifs.c b/fs/ubifs/ubifs.c index 8f1c9d167d..4465523d5f 100644 --- a/fs/ubifs/ubifs.c +++ b/fs/ubifs/ubifs.c @@ -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; }