]> git.baikalelectronics.ru Git - kernel.git/commit
net: mvneta: fix error path for building skb
authorMarcin Wojtas <mw@semihalf.com>
Mon, 30 Nov 2015 12:27:44 +0000 (13:27 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 3 Dec 2015 04:35:05 +0000 (23:35 -0500)
commitb2776b791c36d4ab751a4e9875acdc85d753c3be
tree9a0b6e976964e6d1879db6915ef3475b27fda268
parentc3b5b5f91d0ab5ac976446f236f3bfa49e703af9
net: mvneta: fix error path for building skb

In the actual RX processing, there is same error path for both descriptor
ring refilling and building skb fails. This is not correct, because after
successful refill, the ring is already updated with newly allocated
buffer. Then, in case of build_skb() fail, hitherto code left the original
buffer unmapped.

This patch fixes above situation by swapping error check of skb build with
DMA-unmap of original buffer.

Signed-off-by: Marcin Wojtas <mw@semihalf.com>
Acked-by: Simon Guinot <simon.guinot@sequanux.org>
Cc: <stable@vger.kernel.org> # v4.2+
Fixes 059db4a9b2a1 ("net: mvneta: fix refilling for Rx DMA buffers")
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/marvell/mvneta.c