diff options
author | hayeswang <hayeswang@realtek.com> | 2014-03-07 11:04:35 +0800 |
---|---|---|
committer | Seema Khowala <seemaj@nvidia.com> | 2014-04-23 14:07:35 -0700 |
commit | 8fec9e0be6e073567f39440b5ba0bca51a794996 (patch) | |
tree | 6e3b28c8ba0b4d27ee1677f25ef36352be322af7 /drivers/net | |
parent | 26c6d7f060f47c3ec95475f00f0e9d7d46a5f70c (diff) |
r8152: check tx agg list before spin lock
Check tx agg list before spin lock to avoid doing spin lock every
times.
Change-Id: I6f2533252659317642f49b2260af1e1b00c0081b
Signed-off-by: Hayes Wang <hayeswang@realtek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Aly Hirani <ahirani@nvidia.com>
Reviewed-on: http://git-master/r/390293
(cherry picked from commit ff50c75cf61bd8ec3187a6e995e8b50ff032994c)
Reviewed-on: http://git-master/r/396895
Reviewed-by: Preetham Chandru <pchandru@nvidia.com>
Tested-by: Preetham Chandru <pchandru@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/usb/r8152.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 13dbb7056740..647c2ae4382a 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c @@ -1264,6 +1264,9 @@ static struct tx_agg *r8152_get_tx_agg(struct r8152 *tp) struct tx_agg *agg = NULL; unsigned long flags; + if (list_empty(&tp->tx_free)) + return NULL; + spin_lock_irqsave(&tp->tx_lock, flags); if (!list_empty(&tp->tx_free)) { struct list_head *cursor; |