The self-test was updated to cover zero-length strings; the function
needs to be updated, too.
Reported-by: Geert Uytterhoeven <[email protected]>
Signed-off-by: George Spelvin <[email protected]>
Fixes: fcfd2fbf22d2 ("fs/namei.c: Add hashlen_string() function")
Signed-off-by: Linus Torvalds <[email protected]>
unsigned long len = 0, c;
c = (unsigned char)*name;
- do {
+ while (c) {
len++;
hash = partial_name_hash(c, hash);
c = (unsigned char)name[len];
- } while (c);
+ }
return hashlen_create(end_name_hash(hash), len);
}
EXPORT_SYMBOL(hashlen_string);