X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=net%2Ftipc%2Fuser_reg.c;h=04d1b9be9c5197ccf4ec6c9c9a401985959d50a0;hb=bdbf77d6707a52bdeff223d0a60df12d086d21d7;hp=3f3f933976e9dc27603cff2deec0b74150faebc4;hpb=d04cdb64212eb5ae6a98026a97dda626e40e8e9a;p=linux-2.6-omap-h63xx.git diff --git a/net/tipc/user_reg.c b/net/tipc/user_reg.c index 3f3f933976e..04d1b9be9c5 100644 --- a/net/tipc/user_reg.c +++ b/net/tipc/user_reg.c @@ -67,7 +67,7 @@ struct tipc_user { static struct tipc_user *users = NULL; static u32 next_free_user = MAX_USERID + 1; -static spinlock_t reg_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(reg_lock); /** * reg_init - create TIPC user registry (but don't activate it) @@ -82,9 +82,8 @@ static int reg_init(void) spin_lock_bh(®_lock); if (!users) { - users = (struct tipc_user *)kmalloc(USER_LIST_SIZE, GFP_ATOMIC); + users = kzalloc(USER_LIST_SIZE, GFP_ATOMIC); if (users) { - memset(users, 0, USER_LIST_SIZE); for (i = 1; i <= MAX_USERID; i++) { users[i].next = i - 1; }