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:24:26 +0000 (10:24 +0100)
commit26e6b9f0be83ae820d603bd1cfc6fdc77ea23193
tree6e442dd165db9489641be924d286b090f0c7e848
parent9b72f8c448eceb2d0a683362f4a6f05b6f30c093
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@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/arc/emac_main.c