Skip to content

Commit dc25641

Browse files
ZhiqiangLiu26dchinner
authored andcommitted
xfs: do not need to check return value of xlog_kvmalloc()
In xfs_attri_log_nameval_alloc(), xlog_kvmalloc() is called to alloc memory, which will always return successfully, so we donot need to check return value. Reviewed-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Dave Chinner <david@fromorbit.com>
1 parent 42b7cc1 commit dc25641

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

fs/xfs/xfs_attr_item.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,6 @@ xfs_attri_log_nameval_alloc(
8686
*/
8787
nv = xlog_kvmalloc(sizeof(struct xfs_attri_log_nameval) +
8888
name_len + value_len);
89-
if (!nv)
90-
return nv;
9189

9290
nv->name.i_addr = nv + 1;
9391
nv->name.i_len = name_len;
@@ -441,8 +439,6 @@ xfs_attr_create_intent(
441439
attr->xattri_nameval = xfs_attri_log_nameval_alloc(args->name,
442440
args->namelen, args->value, args->valuelen);
443441
}
444-
if (!attr->xattri_nameval)
445-
return ERR_PTR(-ENOMEM);
446442

447443
attrip = xfs_attri_init(mp, attr->xattri_nameval);
448444
xfs_trans_add_item(tp, &attrip->attri_item);
@@ -762,8 +758,6 @@ xlog_recover_attri_commit_pass2(
762758
nv = xfs_attri_log_nameval_alloc(attr_name,
763759
attri_formatp->alfi_name_len, attr_value,
764760
attri_formatp->alfi_value_len);
765-
if (!nv)
766-
return -ENOMEM;
767761

768762
attrip = xfs_attri_init(mp, nv);
769763
error = xfs_attri_copy_format(&item->ri_buf[0], &attrip->attri_format);

0 commit comments

Comments
 (0)