summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrzej Hajda <a.hajda@samsung.com>2015-09-21 13:33:37 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-09-29 01:57:00 (GMT)
commit92bb833e39feea79827946e1ecbaa7e6dee73fbf (patch)
tree8d7eced0dc5cc351d1a14b642466aa09eb1b88f6
parent4346f9a01fe0846d1399292b53b24f6fde5bd2d9 (diff)
downloadlinux-92bb833e39feea79827946e1ecbaa7e6dee73fbf.tar.xz
staging: lustre: fix handling lustre_posix_acl_xattr_filter result
The function can return negative value. The problem has been detected using proposed semantic patch scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci [1]. [1]: http://permalink.gmane.org/gmane.linux.kernel/2038576 Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/lustre/lustre/llite/xattr.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/staging/lustre/lustre/llite/xattr.c b/drivers/staging/lustre/lustre/llite/xattr.c
index 362a87d..dddc1ff 100644
--- a/drivers/staging/lustre/lustre/llite/xattr.c
+++ b/drivers/staging/lustre/lustre/llite/xattr.c
@@ -175,11 +175,12 @@ int ll_setxattr_common(struct inode *inode, const char *name,
}
ee_free(ee);
} else if (rce->rce_ops == RMT_RSETFACL) {
- size = lustre_posix_acl_xattr_filter(
+ rc = lustre_posix_acl_xattr_filter(
(posix_acl_xattr_header *)value,
size, &new_value);
- if (unlikely(size < 0))
- return size;
+ if (unlikely(rc < 0))
+ return rc;
+ size = rc;
pv = (const char *)new_value;
} else