Commit 92bb833e authored by Andrzej Hajda's avatar Andrzej Hajda Committed by Greg Kroah-Hartman

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/2038576Signed-off-by: default avatarAndrzej Hajda <a.hajda@samsung.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4346f9a0
......@@ -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
......
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