infiniband: nes: return value of skb_linearize should be handled
authorZhouyi Zhou <zhouzhouyi@gmail.com>
Wed, 7 Dec 2016 07:30:05 +0000 (15:30 +0800)
committerDoug Ledford <dledford@redhat.com>
Wed, 14 Dec 2016 19:26:49 +0000 (14:26 -0500)
Return value of skb_linearize should be handled in function
nes_netdev_start_xmit.

Compiled in x86_64
Signed-off-by: Zhouyi Zhou <yizhouzhou@ict.ac.cn>
Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>
Reviewed-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/nes/nes_nic.c

index 311b4ba1cade0b948a480cdfe5e6f8d9d8cd6f36..4dcfe669ebad932d16d174bc3b153a7888318740 100644 (file)
@@ -662,10 +662,14 @@ tso_sq_no_longer_full:
                                nesnic->sq_head &= nesnic->sq_size-1;
                        }
                } else {
-                       nesvnic->linearized_skbs++;
                        hoffset = skb_transport_header(skb) - skb->data;
                        nhoffset = skb_network_header(skb) - skb->data;
-                       skb_linearize(skb);
+                       if (skb_linearize(skb)) {
+                               nesvnic->tx_sw_dropped++;
+                               kfree_skb(skb);
+                               return NETDEV_TX_OK;
+                       }
+                       nesvnic->linearized_skbs++;
                        skb_set_transport_header(skb, hoffset);
                        skb_set_network_header(skb, nhoffset);
                        if (!nes_nic_send(skb, netdev))