diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/rhashtable.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/rhashtable.c b/lib/rhashtable.c index 5d845ffd7982..7a940d92f17e 100644 --- a/lib/rhashtable.c +++ b/lib/rhashtable.c | |||
@@ -438,7 +438,8 @@ EXPORT_SYMBOL_GPL(rhashtable_insert_rehash); | |||
438 | struct bucket_table *rhashtable_insert_slow(struct rhashtable *ht, | 438 | struct bucket_table *rhashtable_insert_slow(struct rhashtable *ht, |
439 | const void *key, | 439 | const void *key, |
440 | struct rhash_head *obj, | 440 | struct rhash_head *obj, |
441 | struct bucket_table *tbl) | 441 | struct bucket_table *tbl, |
442 | void **data) | ||
442 | { | 443 | { |
443 | struct rhash_head *head; | 444 | struct rhash_head *head; |
444 | unsigned int hash; | 445 | unsigned int hash; |
@@ -449,8 +450,11 @@ struct bucket_table *rhashtable_insert_slow(struct rhashtable *ht, | |||
449 | spin_lock_nested(rht_bucket_lock(tbl, hash), SINGLE_DEPTH_NESTING); | 450 | spin_lock_nested(rht_bucket_lock(tbl, hash), SINGLE_DEPTH_NESTING); |
450 | 451 | ||
451 | err = -EEXIST; | 452 | err = -EEXIST; |
452 | if (key && rhashtable_lookup_fast(ht, key, ht->p)) | 453 | if (key) { |
453 | goto exit; | 454 | *data = rhashtable_lookup_fast(ht, key, ht->p); |
455 | if (*data) | ||
456 | goto exit; | ||
457 | } | ||
454 | 458 | ||
455 | err = -E2BIG; | 459 | err = -E2BIG; |
456 | if (unlikely(rht_grow_above_max(ht, tbl))) | 460 | if (unlikely(rht_grow_above_max(ht, tbl))) |