Skip to content

Commit

Permalink
f2fs: remove unnecessary goto statement
Browse files Browse the repository at this point in the history
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: Tiezhu Yang <kernelpatch@126.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
  • Loading branch information
Tiezhu Yang authored and Jaegeuk Kim committed Jul 8, 2016
1 parent 64058be commit a0995af
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/f2fs/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ static int __f2fs_setxattr(struct inode *inode, int index,
int found, newsize;
size_t len;
__u32 new_hsize;
int error = -ENOMEM;
int error = 0;

if (name == NULL)
return -EINVAL;
Expand All @@ -465,7 +465,7 @@ static int __f2fs_setxattr(struct inode *inode, int index,

base_addr = read_all_xattrs(inode, ipage);
if (!base_addr)
goto exit;
return -ENOMEM;

/* find entry with wanted name. */
here = __find_xattr(base_addr, index, len, name);
Expand Down

0 comments on commit a0995af

Please sign in to comment.