net: moxa: replace build_skb() with netdev_alloc_skb_ip_align() / memcpy()
authorJonas Jensen <jonas.jensen@gmail.com>
Mon, 25 Aug 2014 14:22:22 +0000 (16:22 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 26 Aug 2014 00:25:39 +0000 (17:25 -0700)
commit9fe1b3bc8d9182e950a744e4a47187420efa67f3
tree1284841770135bf6cdc76f5aeb102a8fa43f0648
parentb853f31940c84cce6a3f5cb4f529b029906ee69c
net: moxa: replace build_skb() with netdev_alloc_skb_ip_align() / memcpy()

build_skb() is used to make skbs out of existing RX ring memory
which is bad because the RX ring is allocated only once, on probe.
Memory corruption occur because said memory is reclaimed, i.e.
__kfree_skb() (and eventually put_page()).

Replace build_skb() with netdev_alloc_skb_ip_align() and use memcpy().

Remove SKB_DATA_ALIGN() from RX buffer size while we're at it.

Addresses https://bugzilla.kernel.org/show_bug.cgi?id=69041

Signed-off-by: Jonas Jensen <jonas.jensen@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/moxa/moxart_ether.c