mirror of
https://github.com/torvalds/linux.git
synced 2026-06-01 02:53:36 +02:00
eth: gve: add missing netdev locks on reset and shutdown paths
All the misc entry points end up calling into either gve_open()
or gve_close(), they take rtnl_lock today but since the recent
instance locking changes should also take the instance lock.
Found by code inspection and untested.
Fixes: cae03e5bdd ("net: hold netdev instance lock during queue operations")
Acked-by: Stanislav Fomichev <sdf@fomichev.me>
Reviewed-by: Harshitha Ramamurthy <hramamurthy@google.com>
Link: https://patch.msgid.link/20250328164742.1268069-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
0a541eaff5
commit
9e3267cf02
|
|
@ -2077,7 +2077,9 @@ static void gve_handle_reset(struct gve_priv *priv)
|
|||
|
||||
if (gve_get_do_reset(priv)) {
|
||||
rtnl_lock();
|
||||
netdev_lock(priv->dev);
|
||||
gve_reset(priv, false);
|
||||
netdev_unlock(priv->dev);
|
||||
rtnl_unlock();
|
||||
}
|
||||
}
|
||||
|
|
@ -2714,6 +2716,7 @@ static void gve_shutdown(struct pci_dev *pdev)
|
|||
bool was_up = netif_running(priv->dev);
|
||||
|
||||
rtnl_lock();
|
||||
netdev_lock(netdev);
|
||||
if (was_up && gve_close(priv->dev)) {
|
||||
/* If the dev was up, attempt to close, if close fails, reset */
|
||||
gve_reset_and_teardown(priv, was_up);
|
||||
|
|
@ -2721,6 +2724,7 @@ static void gve_shutdown(struct pci_dev *pdev)
|
|||
/* If the dev wasn't up or close worked, finish tearing down */
|
||||
gve_teardown_priv_resources(priv);
|
||||
}
|
||||
netdev_unlock(netdev);
|
||||
rtnl_unlock();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user