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

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: default avatarAndrzej Hajda <a.hajda@samsung.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4346f9a0
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -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