linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / net / core / request_sock.c
index 79ebd75..98f0fc9 100644 (file)
@@ -38,18 +38,20 @@ int reqsk_queue_alloc(struct request_sock_queue *queue,
 {
        const int lopt_size = sizeof(struct listen_sock) +
                              nr_table_entries * sizeof(struct request_sock *);
-       struct listen_sock *lopt = kzalloc(lopt_size, GFP_KERNEL);
+       struct listen_sock *lopt = kmalloc(lopt_size, GFP_KERNEL);
 
        if (lopt == NULL)
                return -ENOMEM;
 
+       memset(lopt, 0, lopt_size);
+
        for (lopt->max_qlen_log = 6;
             (1 << lopt->max_qlen_log) < sysctl_max_syn_backlog;
             lopt->max_qlen_log++);
 
        get_random_bytes(&lopt->hash_rnd, sizeof(lopt->hash_rnd));
        rwlock_init(&queue->syn_wait_lock);
-       queue->rskq_accept_head = NULL;
+       queue->rskq_accept_head = queue->rskq_accept_head = NULL;
        lopt->nr_table_entries = nr_table_entries;
 
        write_lock_bh(&queue->syn_wait_lock);