Commit 45bf77b4 authored by Neil Brown's avatar Neil Brown Committed by Linus Torvalds

[PATCH] nfsd: fix ip_map cache reference count leak.

Fix a leak: when auth_unix_lookup sets CACHE_NEGATIVE, it should also
auth_domain_put() the reference it holds in ipm->m_client, since setting
CACHE_NEGATIVE prevents ip_map_put() from putting the reference itself.
Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
Signed-off-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 086aa2c5
...@@ -316,7 +316,8 @@ struct auth_domain *auth_unix_lookup(struct in_addr addr) ...@@ -316,7 +316,8 @@ struct auth_domain *auth_unix_lookup(struct in_addr addr)
return NULL; return NULL;
if ((ipm->m_client->addr_changes - ipm->m_add_change) >0) { if ((ipm->m_client->addr_changes - ipm->m_add_change) >0) {
set_bit(CACHE_NEGATIVE, &ipm->h.flags); if (test_and_set_bit(CACHE_NEGATIVE, &ipm->h.flags) == 0)
auth_domain_put(&ipm->m_client->h);
rv = NULL; rv = NULL;
} else { } else {
rv = &ipm->m_client->h; rv = &ipm->m_client->h;
......
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