xfs: remove unnecessary null check in xfs_generic_create
authorKaixu Xia <kaixuxia@tencent.com>
Fri, 4 Dec 2020 00:43:19 +0000 (16:43 -0800)
committerDarrick J. Wong <darrick.wong@oracle.com>
Wed, 9 Dec 2020 17:49:38 +0000 (09:49 -0800)
The function posix_acl_release() test the passed-in argument and
move on only when it is non-null, so maybe the null check in
xfs_generic_create is unnecessary.

Signed-off-by: Kaixu Xia <kaixuxia@tencent.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
fs/xfs/xfs_iops.c

index 1414ab7..d1ecf76 100644 (file)
@@ -206,10 +206,8 @@ xfs_generic_create(
        xfs_finish_inode_setup(ip);
 
  out_free_acl:
-       if (default_acl)
-               posix_acl_release(default_acl);
-       if (acl)
-               posix_acl_release(acl);
+       posix_acl_release(default_acl);
+       posix_acl_release(acl);
        return error;
 
  out_cleanup_inode: