[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y1EbRNxRnZ/42G9x@localhost.localdomain>
Date: Thu, 20 Oct 2022 12:56:20 +0300
From: Alexey Dobriyan <adobriyan@...il.com>
To: akpm@...ux-foundation.org
Cc: viro@...iv.linux.org.uk, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH -mm] -funsigned-char, namei: delete cast in
lookup_one_common()
Cast to unsigned int doesn't do anything because two comparisons are
a) for equality, and
b) both '/' and '\0' have non-negative values.
Signed-off-by: Alexey Dobriyan <adobriyan@...il.com>
---
fs/namei.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -2657,7 +2657,7 @@ static int lookup_one_common(struct user_namespace *mnt_userns,
}
while (len--) {
- unsigned int c = *(const unsigned char *)name++;
+ char c = *name++;
if (c == '/' || c == '\0')
return -EACCES;
}
Powered by blists - more mailing lists