From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [PATCH] 3c59x: fix missing dma_mapping_error check Date: Tue, 02 Jan 2018 21:48:27 -0500 (EST) Message-ID: <20180102.214827.2231558813164114000.davem@davemloft.net> References: <20171229164010.1991-1-nhorman@tuxdriver.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, nhorman@redhat.com, klassert@mathematik.tu-chemnitz.de To: nhorman@tuxdriver.com Return-path: Received: from shards.monkeyblade.net ([184.105.139.130]:55168 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751008AbeACCs3 (ORCPT ); Tue, 2 Jan 2018 21:48:29 -0500 In-Reply-To: <20171229164010.1991-1-nhorman@tuxdriver.com> Sender: netdev-owner@vger.kernel.org List-ID: From: Neil Horman 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.