]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Staging: lustre: llite: Remove NULL check before kfree
authorBhumika Goyal <bhumirks@gmail.com>
Fri, 12 Feb 2016 14:37:54 +0000 (20:07 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 15 Feb 2016 00:21:15 +0000 (16:21 -0800)
NULL check before kfree is unnecessary so remove it.
Semantic patch used:
// <smpl>
@@ expression E; @@
- if (E != NULL) { kfree(E); }
+ kfree(E);
@@ expression E; @@
- if (E != NULL) { kfree(E); E = NULL; }
+ kfree(E);
+ E = NULL;
// </smpl>

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/llite/xattr.c

index 8eb43f192d1fa3fea8406ad61466c3fc21c1afe8..fa477e76c7d7bbd46096fcaa2dd09844b05d9b1a 100644 (file)
@@ -192,11 +192,10 @@ int ll_setxattr_common(struct inode *inode, const char *name,
                         valid, name, pv, size, 0, flags,
                         ll_i2suppgid(inode), &req);
 #ifdef CONFIG_FS_POSIX_ACL
-       if (new_value != NULL)
-               /*
-                * Release the posix ACL space.
-                */
-               kfree(new_value);
+       /*
+        * Release the posix ACL space.
+        */
+       kfree(new_value);
        if (acl != NULL)
                lustre_ext_acl_xattr_free(acl);
 #endif