diff options
-rw-r--r-- | net/sunrpc/cache.c | 6 |
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, | |||
71 | new = detail->alloc(); | 71 | new = detail->alloc(); |
72 | if (!new) | 72 | if (!new) |
73 | return NULL; | 73 | return NULL; |
74 | /* must fully initialise 'new', else | ||
75 | * we might get lose if we need to | ||
76 | * cache_put it soon. | ||
77 | */ | ||
74 | cache_init(new); | 78 | cache_init(new); |
79 | detail->init(new, key); | ||
75 | 80 | ||
76 | write_lock(&detail->hash_lock); | 81 | write_lock(&detail->hash_lock); |
77 | 82 | ||
@@ -85,7 +90,6 @@ struct cache_head *sunrpc_cache_lookup(struct cache_detail *detail, | |||
85 | return tmp; | 90 | return tmp; |
86 | } | 91 | } |
87 | } | 92 | } |
88 | detail->init(new, key); | ||
89 | new->next = *head; | 93 | new->next = *head; |
90 | *head = new; | 94 | *head = new; |
91 | detail->entries++; | 95 | detail->entries++; |