提交 dc256418 编写于 作者: Z Zhiqiang Liu 提交者: Dave Chinner

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: NEric Sandeen <sandeen@redhat.com>
Signed-off-by: NZhiqiang Liu <liuzhiqiang26@huawei.com>
Reviewed-by: NDarrick J. Wong <djwong@kernel.org>
Signed-off-by: NDave Chinner <david@fromorbit.com>
上级 42b7cc11
...@@ -86,8 +86,6 @@ xfs_attri_log_nameval_alloc( ...@@ -86,8 +86,6 @@ xfs_attri_log_nameval_alloc(
*/ */
nv = xlog_kvmalloc(sizeof(struct xfs_attri_log_nameval) + nv = xlog_kvmalloc(sizeof(struct xfs_attri_log_nameval) +
name_len + value_len); name_len + value_len);
if (!nv)
return nv;
nv->name.i_addr = nv + 1; nv->name.i_addr = nv + 1;
nv->name.i_len = name_len; nv->name.i_len = name_len;
...@@ -441,8 +439,6 @@ xfs_attr_create_intent( ...@@ -441,8 +439,6 @@ xfs_attr_create_intent(
attr->xattri_nameval = xfs_attri_log_nameval_alloc(args->name, attr->xattri_nameval = xfs_attri_log_nameval_alloc(args->name,
args->namelen, args->value, args->valuelen); args->namelen, args->value, args->valuelen);
} }
if (!attr->xattri_nameval)
return ERR_PTR(-ENOMEM);
attrip = xfs_attri_init(mp, attr->xattri_nameval); attrip = xfs_attri_init(mp, attr->xattri_nameval);
xfs_trans_add_item(tp, &attrip->attri_item); xfs_trans_add_item(tp, &attrip->attri_item);
...@@ -762,8 +758,6 @@ xlog_recover_attri_commit_pass2( ...@@ -762,8 +758,6 @@ xlog_recover_attri_commit_pass2(
nv = xfs_attri_log_nameval_alloc(attr_name, nv = xfs_attri_log_nameval_alloc(attr_name,
attri_formatp->alfi_name_len, attr_value, attri_formatp->alfi_name_len, attr_value,
attri_formatp->alfi_value_len); attri_formatp->alfi_value_len);
if (!nv)
return -ENOMEM;
attrip = xfs_attri_init(mp, nv); attrip = xfs_attri_init(mp, nv);
error = xfs_attri_copy_format(&item->ri_buf[0], &attrip->attri_format); error = xfs_attri_copy_format(&item->ri_buf[0], &attrip->attri_format);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册