aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/name_table.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/tipc/name_table.c')
-rw-r--r--net/tipc/name_table.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/net/tipc/name_table.c b/net/tipc/name_table.c
index 9dfc9127acdd..d8473eefcd23 100644
--- a/net/tipc/name_table.c
+++ b/net/tipc/name_table.c
@@ -1052,12 +1052,11 @@ int tipc_nametbl_init(void)
1052{ 1052{
1053 int array_size = sizeof(struct hlist_head) * tipc_nametbl_size; 1053 int array_size = sizeof(struct hlist_head) * tipc_nametbl_size;
1054 1054
1055 table.types = kmalloc(array_size, GFP_ATOMIC); 1055 table.types = kzalloc(array_size, GFP_ATOMIC);
1056 if (!table.types) 1056 if (!table.types)
1057 return -ENOMEM; 1057 return -ENOMEM;
1058 1058
1059 write_lock_bh(&tipc_nametbl_lock); 1059 write_lock_bh(&tipc_nametbl_lock);
1060 memset(table.types, 0, array_size);
1061 table.local_publ_count = 0; 1060 table.local_publ_count = 0;
1062 write_unlock_bh(&tipc_nametbl_lock); 1061 write_unlock_bh(&tipc_nametbl_lock);
1063 return 0; 1062 return 0;