From a97b1fc51173b7571ec30c39f1345b060da52408 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Sat, 5 Aug 2006 12:14:29 -0700 Subject: [PATCH] --- yaml --- r: 33238 b: refs/heads/master c: 2f34931fdc78b4895553aaa33748939cc7697c99 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/net/sunrpc/cache.c | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 75a4ec15cee0..b69958277bef 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 9b7f750d446a717d4c8346fbb165b62661019b92 +refs/heads/master: 2f34931fdc78b4895553aaa33748939cc7697c99 diff --git a/trunk/net/sunrpc/cache.c b/trunk/net/sunrpc/cache.c index 7026b0866b7b..00cb388ece03 100644 --- a/trunk/net/sunrpc/cache.c +++ b/trunk/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++;