Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

hash_string: Fix zero-length case for !DCACHE_WORD_ACCESS

The self-test was updated to cover zero-length strings; the function
needs to be updated, too.

Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: George Spelvin <linux@sciencehorizons.net>
Fixes: fcfd2fbf22d2 ("fs/namei.c: Add hashlen_string() function")
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

George Spelvin and committed by
Linus Torvalds
e0ab7af9 f2a031b6

+2 -2
+2 -2
fs/namei.c
··· 1968 1968 unsigned long len = 0, c; 1969 1969 1970 1970 c = (unsigned char)*name; 1971 - do { 1971 + while (c) { 1972 1972 len++; 1973 1973 hash = partial_name_hash(c, hash); 1974 1974 c = (unsigned char)name[len]; 1975 - } while (c); 1975 + } 1976 1976 return hashlen_create(end_name_hash(hash), len); 1977 1977 } 1978 1978 EXPORT_SYMBOL(hashlen_string);