diff options
author | Roland Dreier <rdreier@cisco.com> | 2008-10-17 17:18:26 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-10-22 06:22:14 -0400 |
commit | 6d329af9967e7ab3f4a3d7f1e8ef87539c3a069f (patch) | |
tree | 526727c49e03164db570b5652a7ce6702c2138a5 /drivers | |
parent | d766a4eda65b80afb50a39ce15c0ca424115bc07 (diff) |
cxgb3: Fix kernel crash caused by uninitialized l2t_entry.arpq
Commit 147e70e6 ("cxgb3: Use SKB list interfaces instead of home-grown
implementation.") causes a crash in t3_l2t_send_slow() when an iWARP
connection request is received. This is because the new l2t_entry.arpq
skb queue is never initialized, and therefore trying to add an skb to
it causes a NULL dereference. With the old code there was no need to
initialize the queues because the l2t_entry structures were zeroed,
and the code used NULL to mean empty.
Fix this by adding __skb_queue_head_init() when all the l2t_entry
structures get allocated.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/cxgb3/l2t.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/cxgb3/l2t.c b/drivers/net/cxgb3/l2t.c index 4407ac9bb555..ff1611f90e7a 100644 --- a/drivers/net/cxgb3/l2t.c +++ b/drivers/net/cxgb3/l2t.c | |||
@@ -431,6 +431,7 @@ struct l2t_data *t3_init_l2t(unsigned int l2t_capacity) | |||
431 | for (i = 0; i < l2t_capacity; ++i) { | 431 | for (i = 0; i < l2t_capacity; ++i) { |
432 | d->l2tab[i].idx = i; | 432 | d->l2tab[i].idx = i; |
433 | d->l2tab[i].state = L2T_STATE_UNUSED; | 433 | d->l2tab[i].state = L2T_STATE_UNUSED; |
434 | __skb_queue_head_init(&d->l2tab[i].arpq); | ||
434 | spin_lock_init(&d->l2tab[i].lock); | 435 | spin_lock_init(&d->l2tab[i].lock); |
435 | atomic_set(&d->l2tab[i].refcnt, 0); | 436 | atomic_set(&d->l2tab[i].refcnt, 0); |
436 | } | 437 | } |