ramips: mtk_eth_soc: fix NULL pointer dereference for syncp
u64_stats_init() has been unable to handle NULL pointer since 6.1 kernel. This patch fixes kernel oops on mt76x8 and rt305x sub-target. Signed-off-by: Shiji Yang <yangshiji66@qq.com>
This commit is contained in:
parent
3b74ae780c
commit
88d1322fcf
1 changed files with 1 additions and 1 deletions
|
@ -1601,6 +1601,7 @@ static int fe_probe(struct platform_device *pdev)
|
||||||
goto err_free_dev;
|
goto err_free_dev;
|
||||||
}
|
}
|
||||||
spin_lock_init(&priv->hw_stats->stats_lock);
|
spin_lock_init(&priv->hw_stats->stats_lock);
|
||||||
|
u64_stats_init(&priv->hw_stats->syncp);
|
||||||
}
|
}
|
||||||
|
|
||||||
sysclk = devm_clk_get(&pdev->dev, NULL);
|
sysclk = devm_clk_get(&pdev->dev, NULL);
|
||||||
|
@ -1628,7 +1629,6 @@ static int fe_probe(struct platform_device *pdev)
|
||||||
priv->tx_ring.tx_ring_size = NUM_DMA_DESC;
|
priv->tx_ring.tx_ring_size = NUM_DMA_DESC;
|
||||||
priv->rx_ring.rx_ring_size = NUM_DMA_DESC;
|
priv->rx_ring.rx_ring_size = NUM_DMA_DESC;
|
||||||
INIT_WORK(&priv->pending_work, fe_pending_work);
|
INIT_WORK(&priv->pending_work, fe_pending_work);
|
||||||
u64_stats_init(&priv->hw_stats->syncp);
|
|
||||||
|
|
||||||
napi_weight = 16;
|
napi_weight = 16;
|
||||||
if (priv->flags & FE_FLAG_NAPI_WEIGHT) {
|
if (priv->flags & FE_FLAG_NAPI_WEIGHT) {
|
||||||
|
|
Loading…
Reference in a new issue