diff options
Diffstat (limited to 'net/tipc/user_reg.c')
| -rw-r--r-- | net/tipc/user_reg.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/net/tipc/user_reg.c b/net/tipc/user_reg.c index 3f3f933976e9..04d1b9be9c51 100644 --- a/net/tipc/user_reg.c +++ b/net/tipc/user_reg.c | |||
| @@ -67,7 +67,7 @@ struct tipc_user { | |||
| 67 | 67 | ||
| 68 | static struct tipc_user *users = NULL; | 68 | static struct tipc_user *users = NULL; |
| 69 | static u32 next_free_user = MAX_USERID + 1; | 69 | static u32 next_free_user = MAX_USERID + 1; |
| 70 | static spinlock_t reg_lock = SPIN_LOCK_UNLOCKED; | 70 | static DEFINE_SPINLOCK(reg_lock); |
| 71 | 71 | ||
| 72 | /** | 72 | /** |
| 73 | * reg_init - create TIPC user registry (but don't activate it) | 73 | * reg_init - create TIPC user registry (but don't activate it) |
| @@ -82,9 +82,8 @@ static int reg_init(void) | |||
| 82 | 82 | ||
| 83 | spin_lock_bh(®_lock); | 83 | spin_lock_bh(®_lock); |
| 84 | if (!users) { | 84 | if (!users) { |
| 85 | users = (struct tipc_user *)kmalloc(USER_LIST_SIZE, GFP_ATOMIC); | 85 | users = kzalloc(USER_LIST_SIZE, GFP_ATOMIC); |
| 86 | if (users) { | 86 | if (users) { |
| 87 | memset(users, 0, USER_LIST_SIZE); | ||
| 88 | for (i = 1; i <= MAX_USERID; i++) { | 87 | for (i = 1; i <= MAX_USERID; i++) { |
| 89 | users[i].next = i - 1; | 88 | users[i].next = i - 1; |
| 90 | } | 89 | } |
