aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikulas Patocka <mpatocka@redhat.com>2013-09-19 14:13:17 -0400
committerDavid S. Miller <davem@davemloft.net>2013-09-19 14:15:15 -0400
commitc194992cbe71c20bb3623a566af8d11b0bfaa721 (patch)
treeaa1f2cb0781a50980ef012fa5acc35a625b5a4fc
parent703133de331a7a7df47f31fb9de51dc6f68a9de8 (diff)
skge: fix broken driver
The patch 136d8f377e1575463b47840bc5f1b22d94bf8f63 broke the skge driver. Note this part of the patch: + if (skge_rx_setup(skge, e, nskb, skge->rx_buf_size) < 0) { + dev_kfree_skb(nskb); + goto resubmit; + } + pci_unmap_single(skge->hw->pdev, dma_unmap_addr(e, mapaddr), dma_unmap_len(e, maplen), PCI_DMA_FROMDEVICE); skb = e->skb; prefetch(skb->data); - skge_rx_setup(skge, e, nskb, skge->rx_buf_size); The function skge_rx_setup modifies e->skb to point to the new skb. Thus, after this change, the new buffer, not the old, is returned to the networking stack. This bug is present in kernels 3.11, 3.11.1 and 3.12-rc1. The patch should be queued for 3.11-stable. Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Reported-by: Mikulas Patocka <mpatocka@redhat.com> Reported-by: Vasiliy Glazov <vascom2@gmail.com> Tested-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/marvell/skge.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/ethernet/marvell/skge.c b/drivers/net/ethernet/marvell/skge.c
index ef94a591f9e5..1a9c4f6269ea 100644
--- a/drivers/net/ethernet/marvell/skge.c
+++ b/drivers/net/ethernet/marvell/skge.c
@@ -3092,6 +3092,9 @@ static struct sk_buff *skge_rx_get(struct net_device *dev,
3092 if (!nskb) 3092 if (!nskb)
3093 goto resubmit; 3093 goto resubmit;
3094 3094
3095 skb = e->skb;
3096 prefetch(skb->data);
3097
3095 if (skge_rx_setup(skge, e, nskb, skge->rx_buf_size) < 0) { 3098 if (skge_rx_setup(skge, e, nskb, skge->rx_buf_size) < 0) {
3096 dev_kfree_skb(nskb); 3099 dev_kfree_skb(nskb);
3097 goto resubmit; 3100 goto resubmit;
@@ -3101,8 +3104,6 @@ static struct sk_buff *skge_rx_get(struct net_device *dev,
3101 dma_unmap_addr(e, mapaddr), 3104 dma_unmap_addr(e, mapaddr),
3102 dma_unmap_len(e, maplen), 3105 dma_unmap_len(e, maplen),
3103 PCI_DMA_FROMDEVICE); 3106 PCI_DMA_FROMDEVICE);
3104 skb = e->skb;
3105 prefetch(skb->data);
3106 } 3107 }
3107 3108
3108 skb_put(skb, len); 3109 skb_put(skb, len);