OSDN Git Service

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)
committerDavid S. Miller <davem@davemloft.net>
Tue, 19 Dec 2017 18:24:23 +0000 (13:24 -0500)
commite688822d035b494071ecbadcccbd6f3325fb0f59
treeff923bd3c48d2f90919f102f76b99ef7272b5974
parent7352e252b5bf40d59342494a70354a2d436fd0cd
net: arc_emac: fix arc_emac_rx() error paths

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>
drivers/net/ethernet/arc/emac_main.c