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: Olaf Kirch <okir@suse.de>
Acked-by: Neil Brown <neilb@cse.unsw.edu.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
}
/* 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);
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;