aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShannon Nelson <snelson@pensando.io>2020-07-29 10:52:17 -0700
committerDavid S. Miller <davem@davemloft.net>2020-07-30 17:37:16 -0700
commit59929fbb45e06da7d501d3a97f10a91912181f7c (patch)
treec1b549fc1ea0c7697b76aaa16b6fc9e0ae1e9de8
parent51875dad43b44241b46a569493f1e4bfa0386d86 (diff)
downloadide-59929fbb45e06da7d501d3a97f10a91912181f7c.tar.gz
ionic: unlock queue mutex in error path
On an error return, jump to the unlock at the end to be sure to unlock the queue_lock mutex. Fixes: 0925e9db4dc8 ("ionic: use mutex to protect queue operations") Reported-by: kernel test robot <lkp@intel.com> Reported-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Shannon Nelson <snelson@pensando.io> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/pensando/ionic/ionic_lif.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c
index 5fd31ba569372..e55d41546cff2 100644
--- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c
+++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c
@@ -2001,7 +2001,7 @@ int ionic_reset_queues(struct ionic_lif *lif, ionic_reset_cb cb, void *arg)
netif_device_detach(lif->netdev);
err = ionic_stop(lif->netdev);
if (err)
- return err;
+ goto reset_out;
}
if (cb)
@@ -2011,6 +2011,8 @@ int ionic_reset_queues(struct ionic_lif *lif, ionic_reset_cb cb, void *arg)
err = ionic_open(lif->netdev);
netif_device_attach(lif->netdev);
}
+
+reset_out:
mutex_unlock(&lif->queue_lock);
return err;