Commit cb338041 authored by Olaf Kirch's avatar Olaf Kirch Committed by Linus Torvalds

[PATCH] auth_domain_lookup fix

This patch makes sure that auth_domain_lookup returns NULL when it doesn't
find a matching entry, rather than the last entry in the hash chain.
Signed-off-by: default avatarOlaf Kirch <okir@suse.de>
Acked-by: default avatarNeil Brown <neilb@cse.unsw.edu.au>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent b5c42162
......@@ -183,7 +183,7 @@ auth_domain_lookup(struct auth_domain *item, int set)
}
/* Didn't find anything */
if (!set)
goto out_noset;
goto out_nada;
auth_domain_cache.entries++;
out_set:
set_bit(CACHE_HASHED, &item->h.flags);
......@@ -193,6 +193,8 @@ auth_domain_lookup(struct auth_domain *item, int set)
cache_fresh(&auth_domain_cache, &item->h, item->h.expiry_time);
cache_get(&item->h);
return item;
out_nada:
tmp = NULL;
out_noset:
read_unlock(&auth_domain_cache.hash_lock);
return tmp;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment