]> 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)
commit1e7ddfe980c59fbd34490746fc3386cde54619da
tree9a0b6e976964e6d1879db6915ef3475b27fda268
parente8dabf3de46d178c7f631c34afa3855b6851649f
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 a2185bf75d2b ("net: mvneta: fix refilling for Rx DMA buffers")
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/marvell/mvneta.c