From: Sankar P Subject: [PATCH] novfs: code cleanup for one case of novfs return value References: bnc#624606 Patch-mainline: No Code cleanup. One error case returns a positive error value. Changed it to return in negative. Signed-off-by: Sankar P Acked-by: Jan Kara --- fs/novfs/file.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) --- a/fs/novfs/file.c +++ b/fs/novfs/file.c @@ -280,9 +280,8 @@ int novfs_getx_file_info(char *Path, con DbgPrint("xattr: Path = %s, pathlen = %i, Name = %s, namelen = %i", Path, pathlen, Name, namelen); - if (namelen > MAX_XATTR_NAME_LEN) { - return ENOATTR; - } + if (namelen > MAX_XATTR_NAME_LEN) + return -ENOATTR; cmdlen = offsetof(struct novfs_xa_get_request, data) + pathlen + 1 + namelen + 1; // two '\0' cmd = (struct novfs_xa_get_request *) kmalloc(cmdlen, GFP_KERNEL); @@ -375,9 +374,8 @@ int novfs_setx_file_info(char *Path, con DbgPrint("xattr: Path = %s, pathlen = %i, Name = %s, namelen = %i, " "value len = %u", Path, pathlen, Name, namelen, valueLen); - if (namelen > MAX_XATTR_NAME_LEN) { - return ENOATTR; - } + if (namelen > MAX_XATTR_NAME_LEN) + return -ENOATTR; cmdlen = offsetof(struct novfs_xa_set_request, data) + pathlen + 1 + namelen + 1 + valueLen; cmd = (struct novfs_xa_set_request *) kmalloc(cmdlen, GFP_KERNEL);