提交 a0995af6 编写于 作者: T Tiezhu Yang 提交者: Jaegeuk Kim

f2fs: remove unnecessary goto statement

When base_addr is NULL, there is no need to call kzfree,
it should return -ENOMEM directly. Additionally, it is
better to initialize variable 'error' with 0.
Signed-off-by: NTiezhu Yang <kernelpatch@126.com>
Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
上级 64058be9
...@@ -447,7 +447,7 @@ static int __f2fs_setxattr(struct inode *inode, int index, ...@@ -447,7 +447,7 @@ static int __f2fs_setxattr(struct inode *inode, int index,
int found, newsize; int found, newsize;
size_t len; size_t len;
__u32 new_hsize; __u32 new_hsize;
int error = -ENOMEM; int error = 0;
if (name == NULL) if (name == NULL)
return -EINVAL; return -EINVAL;
...@@ -465,7 +465,7 @@ static int __f2fs_setxattr(struct inode *inode, int index, ...@@ -465,7 +465,7 @@ static int __f2fs_setxattr(struct inode *inode, int index,
base_addr = read_all_xattrs(inode, ipage); base_addr = read_all_xattrs(inode, ipage);
if (!base_addr) if (!base_addr)
goto exit; return -ENOMEM;
/* find entry with wanted name. */ /* find entry with wanted name. */
here = __find_xattr(base_addr, index, len, name); here = __find_xattr(base_addr, index, len, name);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册