diff options
Diffstat (limited to 'drivers/net/cxgb3/cxgb3_offload.c')
-rw-r--r-- | drivers/net/cxgb3/cxgb3_offload.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/cxgb3/cxgb3_offload.c b/drivers/net/cxgb3/cxgb3_offload.c index f6ed033efb56..eed7a48e3111 100644 --- a/drivers/net/cxgb3/cxgb3_offload.c +++ b/drivers/net/cxgb3/cxgb3_offload.c | |||
@@ -553,7 +553,9 @@ int cxgb3_alloc_atid(struct t3cdev *tdev, struct cxgb3_client *client, | |||
553 | struct tid_info *t = &(T3C_DATA(tdev))->tid_maps; | 553 | struct tid_info *t = &(T3C_DATA(tdev))->tid_maps; |
554 | 554 | ||
555 | spin_lock_bh(&t->atid_lock); | 555 | spin_lock_bh(&t->atid_lock); |
556 | if (t->afree) { | 556 | if (t->afree && |
557 | t->atids_in_use + atomic_read(&t->tids_in_use) + MC5_MIN_TIDS <= | ||
558 | t->ntids) { | ||
557 | union active_open_entry *p = t->afree; | 559 | union active_open_entry *p = t->afree; |
558 | 560 | ||
559 | atid = (p - t->atid_tab) + t->atid_base; | 561 | atid = (p - t->atid_tab) + t->atid_base; |