]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit548f5e0fbc05a3562606993b432c8070569212cc
tree1284841770135bf6cdc76f5aeb102a8fa43f0648
parentbc46b3a020a4e4c829fb22d8b39864ad86fd38e3
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