net: arc_emac: fix arc_emac_rx() error paths
authorAlexander Kochetkov <al.kochet@gmail.com>
Fri, 15 Dec 2017 17:20:06 +0000 (20:20 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 3 Mar 2018 09:23:22 +0000 (10:23 +0100)
commit95e094a709eabaede6c53272b2d90925c55c02e0
treeec76103ad853ade84e6f7f9fb970a3bea5b025d3
parent757677d0da516f9f60b7a855ecbf10b73263e006
net: arc_emac: fix arc_emac_rx() error paths

[ Upstream commit e688822d035b494071ecbadcccbd6f3325fb0f59 ]

arc_emac_rx() has some issues found by code review.

In case netdev_alloc_skb_ip_align() or dma_map_single() failure
rx fifo entry will not be returned to EMAC.

In case dma_map_single() failure previously allocated skb became
lost to driver. At the same time address of newly allocated skb
will not be provided to EMAC.

Signed-off-by: Alexander Kochetkov <al.kochet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/arc/emac_main.c