From: "Rustad, Mark D" <mark.d.rustad@intel.com>
To: Nicholas Krause <xerofoify@gmail.com>
Cc: "Kirsher, Jeffrey T" <jeffrey.t.kirsher@intel.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"intel-wired-lan@lists.osuosl.org"
<intel-wired-lan@lists.osuosl.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [Intel-wired-lan] [PATCH] fm10k:Fix error handling in the function fm10k_setup_tc
Date: Tue, 20 Oct 2015 23:11:51 +0000 [thread overview]
Message-ID: <6C4F5FD8-58B6-4A4D-8EAF-A02C3DB64560@intel.com> (raw)
In-Reply-To: <1445375114-13378-1-git-send-email-xerofoify@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1684 bytes --]
Nicholas Krause <xerofoify@gmail.com> wrote:
> 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 <xerofoify@gmail.com>
> ---
> 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;
NAK. This will reference an uninitialized err variable when netif_running returns false. The compiler should complain about this, suggesting that it wasn't compiled.
--
Mark Rustad, Networking Division, Intel Corporation
[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 841 bytes --]
next prev parent reply other threads:[~2015-10-20 23:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1445375114-13378-1-git-send-email-xerofoify@gmail.com>
2015-10-20 23:06 ` Jeff Kirsher
2015-10-20 23:11 ` Rustad, Mark D [this message]
2015-10-27 17:23 ` [Intel-wired-lan] " Singh, Krishneil K
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6C4F5FD8-58B6-4A4D-8EAF-A02C3DB64560@intel.com \
--to=mark.d.rustad@intel.com \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=jeffrey.t.kirsher@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=xerofoify@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®