From patchwork Fri Oct 16 19:42:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Krause X-Patchwork-Id: 531591 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id C218C1402B2 for ; Sat, 17 Oct 2015 11:12:35 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=yzt+jvit; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 1365090EBD; Sat, 17 Oct 2015 00:12:35 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1loOG4ua4fiD; Sat, 17 Oct 2015 00:12:34 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 59D6A90F39; Sat, 17 Oct 2015 00:12:34 +0000 (UTC) X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 36BC41C0ED3 for ; Fri, 16 Oct 2015 19:42:38 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 31519A39B6 for ; Fri, 16 Oct 2015 19:42:38 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 221LLoiMXdAs for ; Fri, 16 Oct 2015 19:42:37 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-qg0-f42.google.com (mail-qg0-f42.google.com [209.85.192.42]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 8F446A393B for ; Fri, 16 Oct 2015 19:42:37 +0000 (UTC) Received: by qgad10 with SMTP id d10so16275408qga.3 for ; Fri, 16 Oct 2015 12:42:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=jgBpCzs//hsqA+kJiJJZ3ukaFfo9/+3c4rRXCNYGVd4=; b=yzt+jvitNv6LYYPp3UHxY88PenMWN0oVgTXSt7NVWGpso6IklkaHl+CYI01Bznpy6+ Dzf8+OZpTjbvQPNyVct6vxdZrZPg4STGgwXb/Z0XdfG60JYlRym1Pp8QliJZZ70wBOXV VCxS3xIYsTYtu8kEqWzfWYsFU2yanpWplftGjcyQYZH9U8x8Or6cbauab0VBdu1ILEbg p4vCD2L9JFdWa/LEgaJwoHelpeJR5WfVBe9Ei2KpmJYGKgw4J3x7XqTvng40CK7h6pa1 Nh7dIYjdu+1Wye9Amu/oW16+QH4chFve20D4j6WSLtRjBe5eNKDGXgD6c1j7atmRgRsR lKKQ== X-Received: by 10.140.152.85 with SMTP id 82mr23216172qhy.8.1445024556552; Fri, 16 Oct 2015 12:42:36 -0700 (PDT) Received: from nick-System-Product-Name.hitronhub.home (CPEbc4dfb2691f3-CMbc4dfb2691f0.cpe.net.cable.rogers.com. [99.231.110.121]) by smtp.googlemail.com with ESMTPSA id j193sm8372472qhc.17.2015.10.16.12.42.34 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 16 Oct 2015 12:42:35 -0700 (PDT) From: Nicholas Krause To: jeffrey.t.kirsher@intel.com Date: Fri, 16 Oct 2015 15:42:31 -0400 Message-Id: <1445024551-21281-1-git-send-email-xerofoify@gmail.com> X-Mailer: git-send-email 2.1.4 X-Mailman-Approved-At: Sat, 17 Oct 2015 00:12:33 +0000 Cc: linux-kernel@vger.kernel.org, intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org Subject: [Intel-wired-lan] [PATCH] fm10k:Fix error handling in the function fm10k_probe X-BeenThere: intel-wired-lan@lists.osuosl.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-wired-lan-bounces@lists.osuosl.org Sender: "Intel-wired-lan" This fixes error handling in the function fm10k_probe to properly if the call to the function fm10k_iov_configure has failed by returning a error code before jumping to a new goto label, fm10k_iov_configure to clean up previously allocated resources between this goto label and the previous goto label before finally returning the error code to the callers of the function fm10k_probe Signed-off-by: Nicholas Krause --- drivers/net/ethernet/intel/fm10k/fm10k_pci.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_pci.c b/drivers/net/ethernet/intel/fm10k/fm10k_pci.c index ce53ff2..3d7374e 100644 --- a/drivers/net/ethernet/intel/fm10k/fm10k_pci.c +++ b/drivers/net/ethernet/intel/fm10k/fm10k_pci.c @@ -1844,13 +1844,17 @@ static int fm10k_probe(struct pci_dev *pdev, fm10k_slot_warn(interface); /* enable SR-IOV after registering netdev to enforce PF/VF ordering */ - fm10k_iov_configure(pdev, 0); + err = fm10k_iov_configure(pdev, 0); + if (err) + goto err_iov_configure; /* clear the service task disable bit to allow service task to start */ clear_bit(__FM10K_SERVICE_DISABLE, &interface->state); return 0; - +err_iov_configure: + fm10k_ptp_unregister(interface); + unregister_netdev(netdev); err_register: fm10k_mbx_free_irq(interface); err_mbx_interrupt: