]> git.karo-electronics.de Git - linux-beck.git/commitdiff
f2fs: remove unnecessary goto statement
authorTiezhu Yang <kernelpatch@126.com>
Mon, 27 Jun 2016 23:27:59 +0000 (07:27 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Fri, 8 Jul 2016 17:33:27 +0000 (10:33 -0700)
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>
fs/f2fs/xattr.c

index 8c0a3b36a917d5424ca60f1bbd77f7a5d88f9751..2e8cb873c31e39642dea92d709923c3f6b2eeb05 100644 (file)
@@ -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;
@@ -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);