]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ionic: unlock queue mutex in error path
authorShannon Nelson <snelson@pensando.io>
Wed, 29 Jul 2020 17:52:17 +0000 (10:52 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 5 Aug 2020 07:58:47 +0000 (09:58 +0200)
[ Upstream commit 59929fbb45e06da7d501d3a97f10a91912181f7c ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/pensando/ionic/ionic_lif.c

index 2c3e9ef22129c18405b53d6c5a1ae44e390a4922..337d971ffd92c0eec4f716566226a6e22ab48a44 100644 (file)
@@ -1959,7 +1959,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)
@@ -1969,6 +1969,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;