From patchwork Tue Oct 20 21:05:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Krause X-Patchwork-Id: 533545 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ozlabs.org (Postfix) with ESMTP id 464CD1402CC for ; Wed, 21 Oct 2015 09:58:00 +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=xujzCmVq; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 6AE408B60B; Tue, 20 Oct 2015 22:57:59 +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 LZWybbKFCL8i; Tue, 20 Oct 2015 22:57:59 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 048F7889B3; Tue, 20 Oct 2015 22:57:59 +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 69A551C44B1 for ; Tue, 20 Oct 2015 21:05:20 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 6336B2535F for ; Tue, 20 Oct 2015 21:05:20 +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 uTLokL5PHuHf for ; Tue, 20 Oct 2015 21:05:19 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-qk0-f171.google.com (mail-qk0-f171.google.com [209.85.220.171]) by silver.osuosl.org (Postfix) with ESMTPS id 7764123479 for ; Tue, 20 Oct 2015 21:05:19 +0000 (UTC) Received: by qkcy65 with SMTP id y65so13722311qkc.0 for ; Tue, 20 Oct 2015 14:05:18 -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=BT6UdRhUyi1K+/i89CzVTFs+GsFgUwFX/cRsYzOK2+8=; b=xujzCmVqCvOeDhGZUkg+QfLbnjlWbV/MxBIUIqSCn6ZaCLkP55BSB4+Y7qMTbSW+dt PfGJsQ+LMQJGi1PDYPAhzbfUj6Y+MsK66P9QYTb5vPURCtdKtHiSMRMXY5b6/KoZ3KMI Q6GI34H1BHwk7sGpdJWxijcTn3NM0ol0JHdxLb45I4Hv7xY8NL3eP5QqWFFNDDbAlnNk uqpj/KzipKmDkqCp7AP9USXB9SNmt66+U+5MclmMQ2gzDpW0BDMEQvNrxShDaRjkR+ta UBuIvigSLKNP8oIr3lvZUYZR609UlGDtUOorInFdj2Fe7wtqWIsYqC1qiPZb2hcfB4re l2ng== X-Received: by 10.55.195.198 with SMTP id r67mr6736671qkl.10.1445375118524; Tue, 20 Oct 2015 14:05:18 -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 f1sm1962007qhe.42.2015.10.20.14.05.16 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Oct 2015 14:05:17 -0700 (PDT) From: Nicholas Krause To: jeffrey.t.kirsher@intel.com Date: Tue, 20 Oct 2015 17:05:14 -0400 Message-Id: <1445375114-13378-1-git-send-email-xerofoify@gmail.com> X-Mailer: git-send-email 2.1.4 X-Mailman-Approved-At: Tue, 20 Oct 2015 22:57:57 +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 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_setup_tc to properly check if the call to the function fm10k_open has failed by returning a error and if so return immediately to the caller of the function fm10k_setup_tc to properly signal this non recoverable failure. Signed-off-by: Nicholas Krause Signed-off-by: Nicholas Krause Tested-by: Krishneil Singh --- drivers/net/ethernet/intel/fm10k/fm10k_netdev.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c b/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c index 99228bf..5a4e702 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)) @@ -1175,7 +1176,9 @@ int fm10k_setup_tc(struct net_device *dev, u8 tc) fm10k_mbx_request_irq(interface); if (netif_running(dev)) - fm10k_open(dev); + err = fm10k_open(dev); + if (err) + return err; /* flag to indicate SWPRI has yet to be updated */ interface->flags |= FM10K_FLAG_SWPRI_CONFIG;