瀏覽代碼

net: Fix misplaced parenthesis in virtio_net.c

Commit 2e57b79ccef1ff1422fdf45a9b28fe60f8f084f7 misplaced its
parenthesis and now tx_fifo_errors will only be incremented if an
ENOMEM error is not written to the syslog.

Correct the parenthesis and indentation to the original goal of
counting all non ENOMEM errors and ratelimiting only the messages.

Signed-of-by: Torsten Kaiser <just.for.lkml@googlemail.com>

Signed-off-by: David S. Miller <davem@davemloft.net>
Torsten Kaiser 13 年之前
父節點
當前提交
31304165ff
共有 1 個文件被更改,包括 2 次插入3 次删除
  1. 2 3
      drivers/net/virtio_net.c

+ 2 - 3
drivers/net/virtio_net.c

@@ -626,16 +626,15 @@ static netdev_tx_t start_xmit(struct sk_buff *skb, struct net_device *dev)
 	/* This can happen with OOM and indirect buffers. */
 	/* This can happen with OOM and indirect buffers. */
 	if (unlikely(capacity < 0)) {
 	if (unlikely(capacity < 0)) {
 		if (likely(capacity == -ENOMEM)) {
 		if (likely(capacity == -ENOMEM)) {
-			if (net_ratelimit()) {
+			if (net_ratelimit())
 				dev_warn(&dev->dev,
 				dev_warn(&dev->dev,
 					 "TX queue failure: out of memory\n");
 					 "TX queue failure: out of memory\n");
-			} else {
+		} else {
 			dev->stats.tx_fifo_errors++;
 			dev->stats.tx_fifo_errors++;
 			if (net_ratelimit())
 			if (net_ratelimit())
 				dev_warn(&dev->dev,
 				dev_warn(&dev->dev,
 					 "Unexpected TX queue failure: %d\n",
 					 "Unexpected TX queue failure: %d\n",
 					 capacity);
 					 capacity);
-			}
 		}
 		}
 		dev->stats.tx_dropped++;
 		dev->stats.tx_dropped++;
 		kfree_skb(skb);
 		kfree_skb(skb);