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>
        int found, newsize;
        size_t len;
        __u32 new_hsize;
-       int error = -ENOMEM;
+       int error = 0;
 
        if (name == NULL)
                return -EINVAL;
 
        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);