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

From: David Miller
Date: Tue Dec 19 2017 - 11:41:10 EST


From: Alexander Kochetkov <al.kochet@xxxxxxxxx>
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.
> That old mapping point to old skb buffer. And netif_receive_skb() will be
> called for old skb after that.

I misread the code, sorry. I saw the dma_unmap_addr(xxx, addr) and just
considered 'addr' as the local variable. It's not, it's in fact the
TX struct member.

Let me look at this some more. ;-)