Characters in key are supposed to be handled unsigned. Explicitly cast
key[2] in case the key contains 8-bit ASCII. Even though we cannot
support such keys in indices, we might still use them in module names
and tools like modinfo.
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Link: https://github.com/kmod-project/kmod/pull/pull/248
Signed-off-by: Lucas De Marchi <demarchi@kernel.org>
case 3:
hash += get_unaligned((uint16_t *)key);
hash ^= hash << 16;
- hash ^= key[2] << 18;
+ hash ^= ((uint8_t)key[2]) << 18;
hash += hash >> 11;
break;