Re: [PATCH] net: arc_emac: fix arc_emac_rx() error paths

2017-12-19 Thread Florian Fainelli
On 12/19/2017 07:49 AM, Alexander Kochetkov wrote: > >> 19 дек. 2017 г., в 18:22, David Miller написал(а): >> >> From: Alexander Kochetkov >> Date: Fri, 15 Dec 2017 20:20:06 +0300 >> >>> arc_emac_rx() has some issues found by code review. >>> >>> In case netdev_alloc_skb_ip_align() or dma_map_si

Re: [PATCH] net: arc_emac: fix arc_emac_rx() error paths

2017-12-19 Thread David Miller
From: Alexander Kochetkov Date: Tue, 19 Dec 2017 18:49:48 +0300 >> And then you unmap it. "addr" is the new DMA mapping, not the old one. > > The old mapping should be unmapped here. It refer to old skb what contains > already > received packet. Because buffer doesn’t belong to EMAC anymore. >

Re: [PATCH] net: arc_emac: fix arc_emac_rx() error paths

2017-12-19 Thread Alexander Kochetkov
> 19 дек. 2017 г., в 18:22, David Miller написал(а): > > From: Alexander Kochetkov > Date: Fri, 15 Dec 2017 20:20:06 +0300 > >> 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 EM

Re: [PATCH] net: arc_emac: fix arc_emac_rx() error paths

2017-12-19 Thread David Miller
From: Alexander Kochetkov Date: Fri, 15 Dec 2017 20:20:06 +0300 > 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 b

[PATCH] net: arc_emac: fix arc_emac_rx() error paths

2017-12-15 Thread Alexander Kochetkov
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