netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Samudrala, Sridhar" <sridhar.samudrala@intel.com>
To: Dan Carpenter <dan.carpenter@oracle.com>,
	"David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH 2/2 net-next] net_failover: fix error code in net_failover_create()
Date: Thu, 31 May 2018 10:26:41 -0700	[thread overview]
Message-ID: <b11cf2ca-e230-057c-77c2-4d02efb672b6@intel.com> (raw)
In-Reply-To: <20180531120425.tqwhhfxqawjuvtws@kili.mountain>



On 5/31/2018 5:04 AM, Dan Carpenter wrote:
> We forgot to set the error code on this path.  This function is supposed
> to return error pointers, so with this bug it accidentally returns NULL
> and the caller doesn't check for that.
>
> Fixes: cfc80d9a1163 ("net: Introduce net_failover driver")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Acked-by: Sridhar Samudrala <sridhar.samudrala@intel.com>

>
> diff --git a/drivers/net/net_failover.c b/drivers/net/net_failover.c
> index ef50158e90a9..881f3fa13e6b 100644
> --- a/drivers/net/net_failover.c
> +++ b/drivers/net/net_failover.c
> @@ -761,8 +761,10 @@ struct failover *net_failover_create(struct net_device *standby_dev)
>   	netif_carrier_off(failover_dev);
>   
>   	failover = failover_register(failover_dev, &net_failover_ops);
> -	if (IS_ERR(failover))
> +	if (IS_ERR(failover)) {
> +		err = PTR_ERR(failover);
>   		goto err_failover_register;
> +	}
>   
>   	return failover;
>   

      reply	other threads:[~2018-05-31 17:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-31 12:04 [PATCH 2/2 net-next] net_failover: fix error code in net_failover_create() Dan Carpenter
2018-05-31 17:26 ` Samudrala, Sridhar [this message]

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=b11cf2ca-e230-057c-77c2-4d02efb672b6@intel.com \
    --to=sridhar.samudrala@intel.com \
    --cc=dan.carpenter@oracle.com \
    --cc=davem@davemloft.net \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).