Skip to content

Commit 4fdd1d5

Browse files
ubifs: Use XATTR_*_PREFIX_LEN
...instead of open coding it. Signed-off-by: Richard Weinberger <[email protected]>
1 parent 170eb55 commit 4fdd1d5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/ubifs/xattr.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ static int check_namespace(const struct qstr *nm)
267267

268268
if (!strncmp(nm->name, XATTR_TRUSTED_PREFIX,
269269
XATTR_TRUSTED_PREFIX_LEN)) {
270-
if (nm->name[sizeof(XATTR_TRUSTED_PREFIX) - 1] == '\0')
270+
if (nm->name[XATTR_TRUSTED_PREFIX_LEN] == '\0')
271271
return -EINVAL;
272272
type = TRUSTED_XATTR;
273273
} else if (!strncmp(nm->name, XATTR_USER_PREFIX,
@@ -277,7 +277,7 @@ static int check_namespace(const struct qstr *nm)
277277
type = USER_XATTR;
278278
} else if (!strncmp(nm->name, XATTR_SECURITY_PREFIX,
279279
XATTR_SECURITY_PREFIX_LEN)) {
280-
if (nm->name[sizeof(XATTR_SECURITY_PREFIX) - 1] == '\0')
280+
if (nm->name[XATTR_SECURITY_PREFIX_LEN] == '\0')
281281
return -EINVAL;
282282
type = SECURITY_XATTR;
283283
} else

0 commit comments

Comments
 (0)