Commit 9ccfc29c authored by Florin Malita's avatar Florin Malita Committed by Linus Torvalds

[PATCH] nfsd: sign conversion obscuring errors in nfsd_set_posix_acl()

Assigning the result of posix_acl_to_xattr() to an unsigned data type
(size/size_t) obscures possible errors.

Coverity CID: 1206.
Signed-off-by: default avatarFlorin Malita <fmalita@gmail.com>
Acked-by: default avatarNeilBrown <neilb@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 2adc7d47
...@@ -1922,11 +1922,10 @@ nfsd_set_posix_acl(struct svc_fh *fhp, int type, struct posix_acl *acl) ...@@ -1922,11 +1922,10 @@ nfsd_set_posix_acl(struct svc_fh *fhp, int type, struct posix_acl *acl)
value = kmalloc(size, GFP_KERNEL); value = kmalloc(size, GFP_KERNEL);
if (!value) if (!value)
return -ENOMEM; return -ENOMEM;
size = posix_acl_to_xattr(acl, value, size); error = posix_acl_to_xattr(acl, value, size);
if (size < 0) { if (error < 0)
error = size;
goto getout; goto getout;
} size = error;
} else } else
size = 0; size = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment