kernfs: fix off by one error.
[firefly-linux-kernel-4.4.55.git] / fs / kernfs / dir.c
index 8245d3b348946bb6755a45b0ada5a5b84ae50dcd..0bd05ab26003c49f5ecfb349641754a3dc568408 100644 (file)
@@ -190,7 +190,7 @@ static unsigned int kernfs_name_hash(const char *name, const void *ns)
        hash = (end_name_hash(hash) ^ hash_ptr((void *)ns, 31));
        hash &= 0x7fffffffU;
        /* Reserve hash numbers 0, 1 and INT_MAX for magic directory entries */
-       if (hash < 1)
+       if (hash < 2)
                hash += 2;
        if (hash >= INT_MAX)
                hash = INT_MAX - 1;