Skip to content

Commit

Permalink
hash_string: Fix zero-length case for !DCACHE_WORD_ACCESS
Browse files Browse the repository at this point in the history
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: fcfd2fb ("fs/namei.c: Add hashlen_string() function")
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
George Spelvin authored and torvalds committed May 29, 2016
1 parent f2a031b commit e0ab7af
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -1968,11 +1968,11 @@ u64 hashlen_string(const char *name)
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);
Expand Down

0 comments on commit e0ab7af

Please sign in to comment.