[PATCH RESEND 1/2] erofs: fix ifnullfree.cocci warnings

Chao Yu yuchao0 at huawei.com
Fri Jun 22 11:57:57 AEST 2018

From: kbuild test robot <fengguang.wu at intel.com>

 NULL check before kfree is not needed.

Generated by: scripts/coccinelle/free/ifnullfree.cocci

Fixes: 4f89dfc3f411 ("erofs: update Kconfig and Makefile")
CC: Gao Xiang <gaoxiang25 at huawei.com>
Signed-off-by: kbuild test robot <fengguang.wu at intel.com>
Signed-off-by: Julia Lawall <julia.lawall at lip6.fr>
Signed-off-by: Chao Yu <yuchao0 at huawei.com>
 fs/erofs/super.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/erofs/super.c b/fs/erofs/super.c
index c46d1c65dcbb..7e725bbd9a0e 100644
--- a/fs/erofs/super.c
+++ b/fs/erofs/super.c
@@ -61,8 +61,7 @@ static void i_callback(struct rcu_head *head)
-	if (vi->xattr_shared_xattrs != NULL)
-		kfree(vi->xattr_shared_xattrs);
+	kfree(vi->xattr_shared_xattrs);
 	kmem_cache_free(erofs_inode_cachep, vi);

More information about the Linux-erofs mailing list