diff mbox

[net] ibmveth: check return of skb_linearize in ibmveth_start_xmit

Message ID 1457040156-3377-1-git-send-email-tlfalcon@linux.vnet.ibm.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Thomas Falcon March 3, 2016, 9:22 p.m. UTC
If skb_linearize fails, the driver should drop the packet
instead of trying to copy it into the bounce buffer.

Signed-off-by: Thomas Falcon <tlfalcon@linux.vnet.ibm.com>

---
 drivers/net/ethernet/ibm/ibmveth.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

David Miller March 7, 2016, 7:40 p.m. UTC | #1
From: Thomas Falcon <tlfalcon@linux.vnet.ibm.com>
Date: Thu,  3 Mar 2016 15:22:36 -0600

> If skb_linearize fails, the driver should drop the packet
> instead of trying to copy it into the bounce buffer.
> 
> Signed-off-by: Thomas Falcon <tlfalcon@linux.vnet.ibm.com>

Applied, thank you.
diff mbox

Patch

diff --git a/drivers/net/ethernet/ibm/ibmveth.c b/drivers/net/ethernet/ibm/ibmveth.c
index 335417b..ebe6071 100644
--- a/drivers/net/ethernet/ibm/ibmveth.c
+++ b/drivers/net/ethernet/ibm/ibmveth.c
@@ -1166,7 +1166,10 @@  map_failed:
 	if (!firmware_has_feature(FW_FEATURE_CMO))
 		netdev_err(netdev, "tx: unable to map xmit buffer\n");
 	adapter->tx_map_failed++;
-	skb_linearize(skb);
+	if (skb_linearize(skb)) {
+		netdev->stats.tx_dropped++;
+		goto out;
+	}
 	force_bounce = 1;
 	goto retry_bounce;
 }