瀏覽代碼

Staging: lustre: llite: Remove NULL check before kfree

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>
Bhumika Goyal 9 年之前
父節點
當前提交
da58688fb0
共有 1 個文件被更改,包括 4 次插入5 次删除
  1. 4 5
      drivers/staging/lustre/lustre/llite/xattr.c

+ 4 - 5
drivers/staging/lustre/lustre/llite/xattr.c

@@ -192,11 +192,10 @@ int ll_setxattr_common(struct inode *inode, const char *name,
 			 valid, name, pv, size, 0, flags,
 			 valid, name, pv, size, 0, flags,
 			 ll_i2suppgid(inode), &req);
 			 ll_i2suppgid(inode), &req);
 #ifdef CONFIG_FS_POSIX_ACL
 #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)
 	if (acl != NULL)
 		lustre_ext_acl_xattr_free(acl);
 		lustre_ext_acl_xattr_free(acl);
 #endif
 #endif