summaryrefslogtreecommitdiff
path: root/lib/rhashtable.c
diff options
context:
space:
mode:
authorYing Xue <ying.xue@windriver.com>2015-01-07 08:41:57 +0300
committerDavid S. Miller <davem@davemloft.net>2015-01-09 06:47:13 +0300
commit545a148e43bed67618cc90b66f9864fba0878890 (patch)
tree046a2ed8a78a7412b4a07e8caef5db00f6cb34af /lib/rhashtable.c
parentc0c09bfdc4150b3918526660768585cd477adf35 (diff)
downloadlinux-545a148e43bed67618cc90b66f9864fba0878890.tar.xz
rhashtable: initialize atomic nelems variable
Signed-off-by: Ying Xue <ying.xue@windriver.com> Cc: Thomas Graf <tgraf@suug.ch> Acked-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'lib/rhashtable.c')
-rw-r--r--lib/rhashtable.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/rhashtable.c b/lib/rhashtable.c
index 7fb474b18f1b..8023b554905c 100644
--- a/lib/rhashtable.c
+++ b/lib/rhashtable.c
@@ -847,6 +847,7 @@ int rhashtable_init(struct rhashtable *ht, struct rhashtable_params *params)
if (tbl == NULL)
return -ENOMEM;
+ atomic_set(&ht->nelems, 0);
atomic_set(&ht->shift, ilog2(tbl->size));
RCU_INIT_POINTER(ht->tbl, tbl);
RCU_INIT_POINTER(ht->future_tbl, tbl);