From: Carmeli Tamir Date: Sat, 6 Jul 2019 15:07:38 +0000 (-0400) Subject: security/commoncap: Use xattr security prefix len X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=c5eaab1d131d0a6272df7d55a971a67400d63f56;p=linux.git security/commoncap: Use xattr security prefix len Using the existing defined XATTR_SECURITY_PREFIX_LEN instead of sizeof(XATTR_SECURITY_PREFIX) - 1. Pretty simple cleanup. Signed-off-by: Carmeli Tamir Signed-off-by: James Morris --- diff --git a/security/commoncap.c b/security/commoncap.c index afd9679ca8669..1156178a0c52f 100644 --- a/security/commoncap.c +++ b/security/commoncap.c @@ -920,7 +920,7 @@ int cap_inode_setxattr(struct dentry *dentry, const char *name, /* Ignore non-security xattrs */ if (strncmp(name, XATTR_SECURITY_PREFIX, - sizeof(XATTR_SECURITY_PREFIX) - 1) != 0) + XATTR_SECURITY_PREFIX_LEN) != 0) return 0; /* @@ -952,7 +952,7 @@ int cap_inode_removexattr(struct dentry *dentry, const char *name) /* Ignore non-security xattrs */ if (strncmp(name, XATTR_SECURITY_PREFIX, - sizeof(XATTR_SECURITY_PREFIX) - 1) != 0) + XATTR_SECURITY_PREFIX_LEN) != 0) return 0; if (strcmp(name, XATTR_NAME_CAPS) == 0) {