summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorhayeswang <hayeswang@realtek.com>2014-03-07 07:04:35 +0400
committerDavid S. Miller <davem@davemloft.net>2014-03-08 01:24:28 +0400
commit21949ab7df0d78b575c87c2e70192b487fd37511 (patch)
treea95a435d248a14744f584ec4491b5866676d8bff /drivers
parent2685d4106316e9033f73e631b3bbb9e385123c0a (diff)
downloadlinux-21949ab7df0d78b575c87c2e70192b487fd37511.tar.xz
r8152: check tx agg list before spin lock
Check tx agg list before spin lock to avoid doing spin lock every times. Signed-off-by: Hayes Wang <hayeswang@realtek.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/usb/r8152.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
index 8ecb41b2df09..00b3192568fe 100644
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -1266,6 +1266,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;