]> git.baikalelectronics.ru Git - kernel.git/commit
skge: fix broken driver
authorMikulas Patocka <mpatocka@redhat.com>
Thu, 19 Sep 2013 18:13:17 +0000 (14:13 -0400)
committerDavid S. Miller <davem@davemloft.net>
Thu, 19 Sep 2013 18:15:15 +0000 (14:15 -0400)
commit6223c97bd04ede5221576806d076f7c8c4584f03
treeaa1f2cb0781a50980ef012fa5acc35a625b5a4fc
parent69592470ac47c4db03efad5c18b6f9e4bd97c8b9
skge: fix broken driver

The patch 2c12e6b4045a5d0e09d20242fd2cf5ac0c67305d 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>
drivers/net/ethernet/marvell/skge.c