Skip to content

Commit 545a148

Browse files
ying-xuedavem330
authored andcommitted
rhashtable: initialize atomic nelems variable
Signed-off-by: Ying Xue <[email protected]> Cc: Thomas Graf <[email protected]> Acked-by: Thomas Graf <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent c0c09bf commit 545a148

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/rhashtable.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -847,6 +847,7 @@ int rhashtable_init(struct rhashtable *ht, struct rhashtable_params *params)
847847
if (tbl == NULL)
848848
return -ENOMEM;
849849

850+
atomic_set(&ht->nelems, 0);
850851
atomic_set(&ht->shift, ilog2(tbl->size));
851852
RCU_INIT_POINTER(ht->tbl, tbl);
852853
RCU_INIT_POINTER(ht->future_tbl, tbl);

0 commit comments

Comments
 (0)