From patchwork Fri Oct 9 15:53:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Krause X-Patchwork-Id: 528444 X-Patchwork-Delegate: jeffrey.t.kirsher@intel.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ozlabs.org (Postfix) with ESMTP id EC26F140291 for ; Sat, 10 Oct 2015 08:45:33 +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=Q7HaJb2t; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 7F6FB315C0; Fri, 9 Oct 2015 21:45:32 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id AEnpSejV1LIb; Fri, 9 Oct 2015 21:45:28 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 36E623332C; Fri, 9 Oct 2015 21:45:28 +0000 (UTC) X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 9231E1C1309 for ; Fri, 9 Oct 2015 15:53:26 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 8D73832DE1 for ; Fri, 9 Oct 2015 15:53:26 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IYQM2qDjCXgt for ; Fri, 9 Oct 2015 15:53:25 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ig0-f173.google.com (mail-ig0-f173.google.com [209.85.213.173]) by silver.osuosl.org (Postfix) with ESMTPS id BEECF32ADF for ; Fri, 9 Oct 2015 15:53:25 +0000 (UTC) Received: by igkz10 with SMTP id z10so4633476igk.1 for ; Fri, 09 Oct 2015 08:53:25 -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=iuaocrbv2ozvkCVUyE7gKepq4lI/oRPQZXtNkA164dA=; b=Q7HaJb2tFHWLPBjydT06J/TKeJ3efTss4nApw1q8ZmmFqf35C4E0S0Kw3IJpmBAUgF OIiQOZ7BXreVFlZ3v7oHsUmxAuegVBeQ88ELB2QesLGhG7kzK4nDkHzG6WFWnf03eDfI P+bKxyscJV8ZvVBThxLaIWYU5DTCusBq/XTuLbmUIR+mjKC+vdSMKuCBPj5xGUxUZh5z Xh0lE+dsEOX1/BTtJ80QFaD3Wy7XJhVE84QBoAXGMeWPfkcQFn4JJMoj8bEBh2lCkgvV H/Nz++cTDdWmY2YIFg9K71euL3PVUrFfsZd1bitmwijrF+5KwsSpwrQssS7Lyzo0D6TW sYTQ== X-Received: by 10.50.107.104 with SMTP id hb8mr10745540igb.1.1444406005145; Fri, 09 Oct 2015 08:53:25 -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 i26sm1751850iod.27.2015.10.09.08.53.23 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 09 Oct 2015 08:53:23 -0700 (PDT) From: Nicholas Krause To: jeffrey.t.kirsher@intel.com Date: Fri, 9 Oct 2015 11:53:20 -0400 Message-Id: <1444406000-4446-1-git-send-email-xerofoify@gmail.com> X-Mailer: git-send-email 2.1.4 X-Mailman-Approved-At: Fri, 09 Oct 2015 21:45:26 +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_setup_tc for certain function calls 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 the function fm10k_setup_tc to propley check if the calls to either the function fm10k_init_queueing_scheme or the function fm10k_mbx_request_irq fail by returning a error code to signal that the call to either function has failed. Furthermore if this arises exit immediately from the function fm10k_setup_tc by returning the returned error code from the failed function call to signal to the caller that setting up the tc on the device has failed and the caller needs to handle this failed setup. Signed-off-by: Nicholas Krause Signed-off-by: Nicholas Krause Tested-by: Krishneil Singh --- drivers/net/ethernet/intel/fm10k/fm10k_netdev.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c b/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c index 99228bf..5e9087a 100644 --- a/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c +++ b/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c @@ -1146,6 +1146,7 @@ static struct rtnl_link_stats64 *fm10k_get_stats64(struct net_device *netdev, int fm10k_setup_tc(struct net_device *dev, u8 tc) { struct fm10k_intfc *interface = netdev_priv(dev); + int err; /* Currently only the PF supports priority classes */ if (tc && (interface->hw.mac.type != fm10k_mac_pf)) @@ -1170,9 +1171,13 @@ int fm10k_setup_tc(struct net_device *dev, u8 tc) netdev_reset_tc(dev); netdev_set_num_tc(dev, tc); - fm10k_init_queueing_scheme(interface); + err = fm10k_init_queueing_scheme(interface); + if (err) + return err; - fm10k_mbx_request_irq(interface); + err = fm10k_mbx_request_irq(interface); + if (err) + return err; if (netif_running(dev)) fm10k_open(dev);