From: Florin Malita Date: Sat, 20 May 2006 21:59:58 +0000 (-0700) Subject: [PATCH] nfsd: sign conversion obscuring errors in nfsd_set_posix_acl() X-Git-Tag: v2.6.17-rc5~68 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=9ccfc29c671c9d0a83c2a114d4bc5f85f3cd749d;p=karo-tx-linux.git [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: Florin Malita Acked-by: NeilBrown Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index 6aa92d0e6876..1d65f13f458c 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c @@ -1922,11 +1922,10 @@ nfsd_set_posix_acl(struct svc_fh *fhp, int type, struct posix_acl *acl) value = kmalloc(size, GFP_KERNEL); if (!value) return -ENOMEM; - size = posix_acl_to_xattr(acl, value, size); - if (size < 0) { - error = size; + error = posix_acl_to_xattr(acl, value, size); + if (error < 0) goto getout; - } + size = error; } else size = 0;