From patchwork Sat Dec 9 23:43:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 10103841 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5246660325 for ; Sat, 9 Dec 2017 23:44:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 44E23291DE for ; Sat, 9 Dec 2017 23:44:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 39F84291E3; Sat, 9 Dec 2017 23:44:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C8755291E1 for ; Sat, 9 Dec 2017 23:44:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751251AbdLIXoH (ORCPT ); Sat, 9 Dec 2017 18:44:07 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:44005 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751301AbdLIXoC (ORCPT ); Sat, 9 Dec 2017 18:44:02 -0500 Received: by mail-wm0-f65.google.com with SMTP id n138so8548174wmg.2; Sat, 09 Dec 2017 15:44:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:subject:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=z/e8BCXO3tyrxds5UB/niXWAzL54aZv49nfkGuEBCFw=; b=lkGg1gzykGqhuSkDAqq1IcFpDe0KHIxXXdFQtIrN4hy2iJscmcIo/8O8jQJemdXJkN Oc0AMbeQ9DfVQEM5Ga1s92iYSYfVUDAojgJZ+v2PcbndmEoCfsY2AdFBTZFDvZ5ktG69 l/crvBSjnzqGTX3I5sslWACdzuzEi+YCLhFrgyPQ0/lYgaz87XH3C+41IZ2htFz47DqI faNxc+jTesRakiD9kG+g5BPoE6UcKPmCThRIT3MVVBZb206Hp8CcLUH90Vnfe/whoIJ4 R4M33CfToe7JtR1BzcdU0oVTh87pQfcwGWD9MQ0fRrnAS4fpf1SgFMfMis0IOxlGE3jE 4mvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=z/e8BCXO3tyrxds5UB/niXWAzL54aZv49nfkGuEBCFw=; b=SQZyY6++tQ1FF8dr6duLloOSIXEDE7lbPjqddLchUQ3VDs39Z+1kBlVhMEwi075Rye kkvYgcuoFm9loUMtRUsYUyPnKncg9XISgBu/rn1DTFH9p0EEpMvQxcx1z2bJBANjV6vJ pWGvJWkfrXkDRcu3b+O0e0KQ9rbP6Dh5HkHsfJISPooIUON202UmQhLEIMKMZvwEE2Dq uHzphuky/804E3ag5+2nVsOe2d/3nEeveBmaMFP9MK2D5Ht+d+10JRV70Yiqffv7iS4x NLXu2LP9lmiNI5gOJn1uYbOtFIyrN7cYsMFczpOFoE8YeuZcJhiSHaGhQC/jE7YNYDQE Xd0Q== X-Gm-Message-State: AKGB3mLzJPzXgmZTdZJydlUueJ6FcGTvG9/YrKofukTeeQJomRiaHL/o I8IaFKQg2P4AetfUezOKkbZopA== X-Google-Smtp-Source: AGs4zMZ9cCcY1E3nAZavI+FbSihdKrZA5phkoyVI9NXpHX6W21jmTbNYhazhh+t/nprnHYaWHVd9Yw== X-Received: by 10.28.88.137 with SMTP id m131mr7164136wmb.48.1512863040587; Sat, 09 Dec 2017 15:44:00 -0800 (PST) Received: from ?IPv6:2003:ea:8bc0:e400:7c68:4b91:65b0:560? (p200300EA8BC0E4007C684B9165B00560.dip0.t-ipconnect.de. [2003:ea:8bc0:e400:7c68:4b91:65b0:560]) by smtp.googlemail.com with ESMTPSA id a22sm5006398wme.46.2017.12.09.15.43.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 09 Dec 2017 15:44:00 -0800 (PST) From: Heiner Kallweit Subject: [PATCH 3/3] r8169: remove netif_napi_del in probe error path To: Realtek linux nic maintainers , Bjorn Helgaas Cc: "netdev@vger.kernel.org" , "linux-pci@vger.kernel.org" References: <9eee5aba-a739-a609-fd65-76666f377ed1@gmail.com> Message-ID: <9b78225d-f1dd-a078-aaa8-cddf2998855b@gmail.com> Date: Sun, 10 Dec 2017 00:43:53 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <9eee5aba-a739-a609-fd65-76666f377ed1@gmail.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP netif_napi_del is called implicitely by free_netdev, therefore we don't have to do it explicitely. When the probe error path is reached, the net_device isn't registered yet. Therefore reordering the call to netif_napi_del shouldn't cause any issues. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8169.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c index 3c7d90d3a..857f67beb 100644 --- a/drivers/net/ethernet/realtek/r8169.c +++ b/drivers/net/ethernet/realtek/r8169.c @@ -8672,14 +8672,12 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) tp->counters = dmam_alloc_coherent (&pdev->dev, sizeof(*tp->counters), &tp->counters_phys_addr, GFP_KERNEL); - if (!tp->counters) { - rc = -ENOMEM; - goto err_out_msi_5; - } + if (!tp->counters) + return -ENOMEM; rc = register_netdev(dev); if (rc < 0) - goto err_out_msi_5; + return rc; pci_set_drvdata(pdev, dev); @@ -8709,11 +8707,6 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) netif_carrier_off(dev); return 0; - -err_out_msi_5: - netif_napi_del(&tp->napi); - - return rc; } static struct pci_driver rtl8169_pci_driver = {