diff options
Diffstat (limited to 'net/tipc/name_table.c')
-rw-r--r-- | net/tipc/name_table.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/net/tipc/name_table.c b/net/tipc/name_table.c index ac7dfdda7973..892373e498e4 100644 --- a/net/tipc/name_table.c +++ b/net/tipc/name_table.c | |||
@@ -1050,15 +1050,12 @@ void tipc_nametbl_dump(void) | |||
1050 | 1050 | ||
1051 | int tipc_nametbl_init(void) | 1051 | int tipc_nametbl_init(void) |
1052 | { | 1052 | { |
1053 | int array_size = sizeof(struct hlist_head) * tipc_nametbl_size; | 1053 | table.types = kcalloc(tipc_nametbl_size, sizeof(struct hlist_head), |
1054 | 1054 | GFP_ATOMIC); | |
1055 | table.types = kzalloc(array_size, GFP_ATOMIC); | ||
1056 | if (!table.types) | 1055 | if (!table.types) |
1057 | return -ENOMEM; | 1056 | return -ENOMEM; |
1058 | 1057 | ||
1059 | write_lock_bh(&tipc_nametbl_lock); | ||
1060 | table.local_publ_count = 0; | 1058 | table.local_publ_count = 0; |
1061 | write_unlock_bh(&tipc_nametbl_lock); | ||
1062 | return 0; | 1059 | return 0; |
1063 | } | 1060 | } |
1064 | 1061 | ||