From patchwork Thu Jan 28 21:25:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Troy Kisky X-Patchwork-Id: 8154481 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1514ABEEE5 for ; Thu, 28 Jan 2016 21:56:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3B96E2021B for ; Thu, 28 Jan 2016 21:56:14 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7322F20218 for ; Thu, 28 Jan 2016 21:56:13 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aOuWk-0007Zg-8g; Thu, 28 Jan 2016 21:54:54 +0000 Received: from mail-pf0-x232.google.com ([2607:f8b0:400e:c00::232]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aOu7y-00064b-A2 for linux-arm-kernel@lists.infradead.org; Thu, 28 Jan 2016 21:29:19 +0000 Received: by mail-pf0-x232.google.com with SMTP id x125so29978780pfb.0 for ; Thu, 28 Jan 2016 13:28:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=boundarydevices-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=G4JXJwlaMwR1P78fEMYgkAH9bUfC2qYV+6WYeyPL0jE=; b=e73Vbv1oVvXLzM5PVOF4T8cJ0yxTD9++sBhDCGsorHKN7RWDW+GUYJWr5nwq7LEr9h X6iYGOwcNg8ZHpvZKRrO3Dy6z2bsNN6knKQKzhdS976DBveXxiuF+q/OZt0H1iAkjhOu nhr9Q2i16qcCdprDVUgIGfhXY65RNW1PsCh1huXL3qy7wIPTCi1czkCjggG91XJzcUfs dYRD51fenZVn2C8yi6BUYXryS2ibjXsMUqQx0Lzy71er8R14bup3DMGg3r0TJ52VGXmZ ofeWuumJDAKJKV4pIiFqAd4CukqIo0zXAilzkWNk1ZXQZCeR5oTRNlQgLUwZXOVh/ihi wxWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=G4JXJwlaMwR1P78fEMYgkAH9bUfC2qYV+6WYeyPL0jE=; b=Dnfc+hzRkaLdx6WA2GhWJZTO+8iOsV36gva/YynWaOGRJNVKljOXhAZQWulz2b9Bp7 6zdvmryI3w9EXJCPMQWSUM8gAB7+4FKsxCCoQZLn/T4xd70LrhMFXUh0Z9imZUHx5Bk4 DZ1FWTWetfSqdubekF5pO/YjF+6PjbZOG1zMIsJK7NWa7xFhCPusAYpDgfiIvEd8VjXS x8AD1nEjitGBhcSFnwErwxmOU+Ve1TctE2cYQBZSXPZ1qQBNsGP64DcEBnFKbp1w45+z qYXiWzWA8piAW68EYrzbhslD2Qi6ftTCpqjYkMEYPqMXca0QlTEvRA6eQZR/9tKLs2DB IEVA== X-Gm-Message-State: AG10YOQ4VdLIiYQMNi4Ohjf8Q3E/FO0GsDJFzhY4MYeXmAUPOCCg+wn9K5VnwpxY16CZjg== X-Received: by 10.98.89.215 with SMTP id k84mr8084110pfj.66.1454016537594; Thu, 28 Jan 2016 13:28:57 -0800 (PST) Received: from localhost.localdomain (wsip-70-184-93-199.ph.ph.cox.net. [70.184.93.199]) by smtp.googlemail.com with ESMTPSA id c90sm18583190pfd.31.2016.01.28.13.28.56 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 28 Jan 2016 13:28:56 -0800 (PST) From: Troy Kisky To: netdev@vger.kernel.org, davem@davemloft.net, B38611@freescale.com Subject: [PATCH net-next 29/40] net: fec: don't free skb when returning busy Date: Thu, 28 Jan 2016 14:25:53 -0700 Message-Id: <1454016364-30985-30-git-send-email-troy.kisky@boundarydevices.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1454016364-30985-1-git-send-email-troy.kisky@boundarydevices.com> References: <1454016364-30985-1-git-send-email-troy.kisky@boundarydevices.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160128_132918_606281_8CA1053B X-CRM114-Status: UNSURE ( 9.02 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fabio.estevam@freescale.com, andrew@lunn.ch, linux@arm.linux.org.uk, Troy Kisky , laci@boundarydevices.com, l.stach@pengutronix.de, shawnguo@kernel.org, linux-arm-kernel@lists.infradead.org, tremyfr@gmail.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From Documentation/networking/driver.txt If you return NETDEV_TX_BUSY from the ndo_start_xmit method, you must not keep any reference to that SKB and you must not attempt to free it up. Signed-off-by: Troy Kisky --- drivers/net/ethernet/freescale/fec_main.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index e141f6f..3a82bfe 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -558,7 +558,6 @@ fec_enet_txq_put_data_tso(struct fec_enet_priv_tx_q *txq, struct sk_buff *skb, addr = dma_map_single(&fep->pdev->dev, data, size, DMA_TO_DEVICE); if (dma_mapping_error(&fep->pdev->dev, addr)) { - dev_kfree_skb_any(skb); if (net_ratelimit()) netdev_err(ndev, "Tx DMA memory map failed\n"); return NETDEV_TX_BUSY; @@ -616,7 +615,6 @@ fec_enet_txq_put_hdr_tso(struct fec_enet_priv_tx_q *txq, dmabuf = dma_map_single(&fep->pdev->dev, bufaddr, hdr_len, DMA_TO_DEVICE); if (dma_mapping_error(&fep->pdev->dev, dmabuf)) { - dev_kfree_skb_any(skb); if (net_ratelimit()) netdev_err(ndev, "Tx DMA memory map failed\n"); return NETDEV_TX_BUSY;