From patchwork Sat Oct 24 04:09:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Krause X-Patchwork-Id: 535369 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 9753D141310 for ; Sat, 24 Oct 2015 16:22: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=qNZX/M+8; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id B1FDD89C95; Sat, 24 Oct 2015 05:22:32 +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 3m+lufGDITtg; Sat, 24 Oct 2015 05:22:32 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 2B9D388C57; Sat, 24 Oct 2015 05:22:32 +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 054421C0046 for ; Sat, 24 Oct 2015 04:09:57 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id F276630BF3 for ; Sat, 24 Oct 2015 04:09:56 +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 uCxLSWl-GL46 for ; Sat, 24 Oct 2015 04:09:56 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ig0-f196.google.com (mail-ig0-f196.google.com [209.85.213.196]) by silver.osuosl.org (Postfix) with ESMTPS id 3D3D2266F3 for ; Sat, 24 Oct 2015 04:09:56 +0000 (UTC) Received: by igbhv6 with SMTP id hv6so4044452igb.2 for ; Fri, 23 Oct 2015 21:09:55 -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=bFqrrGLxpW60DNdCl1wK2m0nzmglPFcymqkn06kvFy0=; b=qNZX/M+8TLm5g5Hy84srJ5MRSMTUDtLzY8jOJkiwAFW4HZpKnOtj+PrkGTf0GZgwjp bK0e5d9ngSd6Scs/TyKfWVLPgPXvxoYedAQ3yv6jUwe87W7Slckq2L1s5buYx0H87X9F XQWETF2PZ1t4sXd9Pn6BBWUBPqgiFjq/FsMGTpKEgRPXr52IXkAnE9p7EswH1aJgzIEJ wBWODUWXbSsGlk3qvOpobz8CKHE1zJptohR/ynunu2HAxRpeCJNkRAkXifC7wK5LpXQk 5FV0TdnhwQSQTHY7ypT1C5dkYEEabo2VOmw8xry3Xx5CLW7gvVrFiSIeNvnBhonErpwC XhVw== X-Received: by 10.50.128.194 with SMTP id nq2mr7767957igb.19.1445659795623; Fri, 23 Oct 2015 21:09:55 -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 bc4sm2593992igb.2.2015.10.23.21.09.54 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 23 Oct 2015 21:09:54 -0700 (PDT) From: Nicholas Krause To: jeffrey.t.kirsher@intel.com Date: Sat, 24 Oct 2015 00:09:51 -0400 Message-Id: <1445659791-30497-1-git-send-email-xerofoify@gmail.com> X-Mailer: git-send-email 2.1.4 X-Mailman-Approved-At: Sat, 24 Oct 2015 05:22:30 +0000 Cc: linux-kernel@vger.kernel.org, intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org Subject: [Intel-wired-lan] [PATCH] e1000e:Fix incorrect assumption that the function e1000e_up always runs successfully in e1000_change_mtu 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 e1000_change_mtu to properly check and run the error code by e1000e_up as this function can fail and the error code should be returned to the caller of the function e1000_change_mtu to signal a error has occurred when calling this particular function Signed-off-by: Nicholas Krause --- drivers/net/ethernet/intel/e1000e/netdev.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c index faf4b3f..aebccb1 100644 --- a/drivers/net/ethernet/intel/e1000e/netdev.c +++ b/drivers/net/ethernet/intel/e1000e/netdev.c @@ -5931,6 +5931,7 @@ static int e1000_change_mtu(struct net_device *netdev, int new_mtu) { struct e1000_adapter *adapter = netdev_priv(netdev); int max_frame = new_mtu + VLAN_ETH_HLEN + ETH_FCS_LEN; + int err = 0; /* Jumbo frame support */ if ((max_frame > (VLAN_ETH_FRAME_LEN + ETH_FCS_LEN)) && @@ -5984,7 +5985,9 @@ static int e1000_change_mtu(struct net_device *netdev, int new_mtu) adapter->rx_buffer_len = VLAN_ETH_FRAME_LEN + ETH_FCS_LEN; if (netif_running(netdev)) - e1000e_up(adapter); + err = e1000e_up(adapter); + if (err) + e_err("Failed to successfully bring up this adapter\n"); else e1000e_reset(adapter); @@ -5992,7 +5995,7 @@ static int e1000_change_mtu(struct net_device *netdev, int new_mtu) clear_bit(__E1000_RESETTING, &adapter->state); - return 0; + return err; } static int e1000_mii_ioctl(struct net_device *netdev, struct ifreq *ifr,