All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net_failover: fixed rollback in net_failover_open()
@ 2020-06-02 12:55 Vasily Averin
  2020-06-02 22:36 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Vasily Averin @ 2020-06-02 12:55 UTC (permalink / raw)
  To: netdev; +Cc: Sridhar Samudrala, David S. Miller, Jakub Kicinski

found by smatch:
drivers/net/net_failover.c:65 net_failover_open() error:
 we previously assumed 'primary_dev' could be null (see line 43)

cc: stable@vger.kernel.org
Fixes: cfc80d9a1163 ("net: Introduce net_failover driver")
Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
---
 drivers/net/net_failover.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/net_failover.c b/drivers/net/net_failover.c
index b16a122..fb182be 100644
--- a/drivers/net/net_failover.c
+++ b/drivers/net/net_failover.c
@@ -61,7 +61,8 @@ static int net_failover_open(struct net_device *dev)
 	return 0;
 
 err_standby_open:
-	dev_close(primary_dev);
+	if (primary_dev)
+		dev_close(primary_dev);
 err_primary_open:
 	netif_tx_disable(dev);
 	return err;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] net_failover: fixed rollback in net_failover_open()
  2020-06-02 12:55 [PATCH] net_failover: fixed rollback in net_failover_open() Vasily Averin
@ 2020-06-02 22:36 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-06-02 22:36 UTC (permalink / raw)
  To: vvs; +Cc: netdev, sridhar.samudrala, kuba

From: Vasily Averin <vvs@virtuozzo.com>
Date: Tue, 2 Jun 2020 15:55:26 +0300

> found by smatch:
> drivers/net/net_failover.c:65 net_failover_open() error:
>  we previously assumed 'primary_dev' could be null (see line 43)
> 
> cc: stable@vger.kernel.org
> Fixes: cfc80d9a1163 ("net: Introduce net_failover driver")
> Signed-off-by: Vasily Averin <vvs@virtuozzo.com>

Do not CC: stable for networking patches in the future please.

Applied, and queued up for -stable, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-06-02 22:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-02 12:55 [PATCH] net_failover: fixed rollback in net_failover_open() Vasily Averin
2020-06-02 22:36 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.