Fix stmmac nullptr dereference

```
Apr 08 11:15:37 conga-smarc-2 kernel:  hrtimer_try_to_cancel+0x15/0x130
Apr 08 11:15:37 conga-smarc-2 kernel:  hrtimer_cancel+0x11/0x30
Apr 08 11:15:37 conga-smarc-2 kernel:  stmmac_release+0xea/0x3a0 [ec_dwmac_intel]
Apr 08 11:15:37 conga-smarc-2 kernel:  ec_device_close+0x2d/0x40 [ec_master]
```
This commit is contained in:
Bjarne von Horn 2024-04-08 11:35:14 +02:00
parent 42d376ed53
commit 44439c3ea0
1 changed files with 4 additions and 2 deletions

View File

@ -3983,8 +3983,10 @@ static int stmmac_release(struct net_device *dev)
stmmac_disable_all_queues(priv);
for (chan = 0; chan < priv->plat->tx_queues_to_use; chan++)
hrtimer_cancel(&priv->dma_conf.tx_queue[chan].txtimer);
if (!get_ecdev(priv)) {
for (chan = 0; chan < priv->plat->tx_queues_to_use; chan++)
hrtimer_cancel(&priv->dma_conf.tx_queue[chan].txtimer);
}
netif_tx_disable(dev);