]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 Dec 2015 19:34:24 +0000 (14:34 -0500)
commited42098a90ca511bd74a55a29db6f0f8bd193d2c
tree0517764b1614045a6c4ef4469b7660776a83999a
parentbf14478a37d1f22b04025714f88b5e18edd57b31
net: mvneta: fix error path for building skb

commit 26c17a179f3f64f92de6e837c14279a6431a7ab6 upstream.

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>
Fixes a84e32894191 ("net: mvneta: fix refilling for Rx DMA buffers")
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/marvell/mvneta.c