Revert to Fedora kernel-2.6.17-1.2187_FC5 patched with vs2.0.2.1; there are too many...
[linux-2.6.git] / net / tipc / user_reg.c
index 04d1b9b..3f3f933 100644 (file)
@@ -67,7 +67,7 @@ struct tipc_user {
 
 static struct tipc_user *users = NULL;
 static u32 next_free_user = MAX_USERID + 1;
-static DEFINE_SPINLOCK(reg_lock);
+static spinlock_t reg_lock = SPIN_LOCK_UNLOCKED;
 
 /**
  * reg_init - create TIPC user registry (but don't activate it)
@@ -82,8 +82,9 @@ static int reg_init(void)
        
        spin_lock_bh(&reg_lock);
        if (!users) {
-               users = kzalloc(USER_LIST_SIZE, GFP_ATOMIC);
+               users = (struct tipc_user *)kmalloc(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;
                        }