* [PATCH 2/2 net-next] net_failover: fix error code in net_failover_create()
@ 2018-05-31 12:04 Dan Carpenter
2018-05-31 17:26 ` Samudrala, Sridhar
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2018-05-31 12:04 UTC (permalink / raw)
To: David S. Miller, Sridhar Samudrala; +Cc: netdev, kernel-janitors
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>
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;
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 2/2 net-next] net_failover: fix error code in net_failover_create()
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
0 siblings, 0 replies; 2+ messages in thread
From: Samudrala, Sridhar @ 2018-05-31 17:26 UTC (permalink / raw)
To: Dan Carpenter, David S. Miller; +Cc: netdev, kernel-janitors
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;
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-05-31 17:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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).