[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180102.214827.2231558813164114000.davem@davemloft.net>
Date: Tue, 02 Jan 2018 21:48:27 -0500 (EST)
From: David Miller <davem@...emloft.net>
To: nhorman@...driver.com
Cc: netdev@...r.kernel.org, nhorman@...hat.com,
klassert@...hematik.tu-chemnitz.de
Subject: Re: [PATCH] 3c59x: fix missing dma_mapping_error check
From: Neil Horman <nhorman@...driver.com>
Date: Fri, 29 Dec 2017 11:40:10 -0500
> @@ -2067,6 +2072,9 @@ vortex_start_xmit(struct sk_buff *skb, struct net_device *dev)
> int len = (skb->len + 3) & ~3;
> vp->tx_skb_dma = pci_map_single(VORTEX_PCI(vp), skb->data, len,
> PCI_DMA_TODEVICE);
> + if (dma_mapping_error(&VORTEX_PCI(vp)->dev, vp->tx_skb_dma))
> + return NETDEV_TX_OK;
> +
This leaks the SKB, right?
And for the RX cases, it allows the RX ring to deplete to empty which
tends to hang most chips. You need to make the DMA failure detection
early and recycle the RX buffer back to the chip instead of passing
it up to the stack.
Powered by blists - more mailing lists