summaryrefslogtreecommitdiff
path: root/net/sunrpc/cache.c
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2006-08-07 06:43:17 -0400
committerJeff Garzik <jeff@garzik.org>2006-08-07 06:43:17 -0400
commit38ebb1e0ed214efe124534eba4a34e869a0d8da7 (patch)
tree3712611527654e81109d194d903401c86763e3f4 /net/sunrpc/cache.c
parent236a686b56428a8967a057a2396f9be74e2ee652 (diff)
parent9f737633e6ee54fc174282d49b2559bd2208391d (diff)
downloadlinux-rt-38ebb1e0ed214efe124534eba4a34e869a0d8da7.tar.gz
Merge branch 'master' into upstream
Diffstat (limited to 'net/sunrpc/cache.c')
-rw-r--r--net/sunrpc/cache.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c
index 7026b0866b7b..00cb388ece03 100644
--- a/net/sunrpc/cache.c
+++ b/net/sunrpc/cache.c
@@ -71,7 +71,12 @@ struct cache_head *sunrpc_cache_lookup(struct cache_detail *detail,
new = detail->alloc();
if (!new)
return NULL;
+ /* must fully initialise 'new', else
+ * we might get lose if we need to
+ * cache_put it soon.
+ */
cache_init(new);
+ detail->init(new, key);
write_lock(&detail->hash_lock);
@@ -85,7 +90,6 @@ struct cache_head *sunrpc_cache_lookup(struct cache_detail *detail,
return tmp;
}
}
- detail->init(new, key);
new->next = *head;
*head = new;
detail->entries++;