rhashtable: initialize atomic nelems variable
authorYing Xue <ying.xue@windriver.com>
Wed, 7 Jan 2015 05:41:57 +0000 (13:41 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 9 Jan 2015 03:47:13 +0000 (19:47 -0800)
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>
lib/rhashtable.c

index 7fb474b18f1b8d7168315e2eb688c57aef4a2ecb..8023b554905c0e76b35c7361038e6a6349acb87b 100644 (file)
@@ -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);