summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorBjørn Mork <bjorn@mork.no>2014-05-16 21:48:29 +0200
committerDavid S. Miller <davem@davemloft.net>2014-05-16 22:39:02 -0400
commit046c65946e3d1bbc70282f43c9cd39b1d430640b (patch)
tree72cc86f2980b6865b69473b5980a41e9eb553c9a /drivers
parentfa83dbeee55865678025b6c1637ca08860209f87 (diff)
net: cdc_ncm: do not start timer on an empty skb
We can end up with a freshly allocated tx_curr_skb with no frames in it. In this case it does not make any sense to start the timer. This avoids the timer periodically trying to start tx when there is nothing in the queue. Signed-off-by: Bjørn Mork <bjorn@mork.no> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/usb/cdc_ncm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c
index 783c4ed96395..2d0caf1eea25 100644
--- a/drivers/net/usb/cdc_ncm.c
+++ b/drivers/net/usb/cdc_ncm.c
@@ -1069,8 +1069,8 @@ cdc_ncm_fill_tx_frame(struct usbnet *dev, struct sk_buff *skb, __le32 sign)
return skb_out;
exit_no_skb:
- /* Start timer, if there is a remaining skb */
- if (ctx->tx_curr_skb != NULL)
+ /* Start timer, if there is a remaining non-empty skb */
+ if (ctx->tx_curr_skb != NULL && n > 0)
cdc_ncm_tx_timeout_start(ctx);
return NULL;
}