Message ID | 20220914200641.zvib2kpo2t26u6ai@pali (mailing list archive) |
---|---|
State | Not Applicable |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | Regression: qca8k_sw_probe crashes (Was: Re: [net-next PATCH v5 01/14] net: dsa: qca8k: cache match data to speed up access) | expand |
Context | Check | Description |
---|---|---|
netdev/tree_selection | success | Guessing tree name failed - patch did not apply |
On Wed, Sep 14, 2022 at 10:06:41PM +0200, Pali Rohár wrote: > Hello! This commit is causing kernel crash on powerpc P2020 based board > with QCA8337N-AL3C switch. > So function of_device_get_match_data() takes as its argument NULL > pointer as 'priv' structure is at this stage zeroed, and which cause > above kernel crash. priv->dev is filled lines below: Thanks for the report, it was solved in 'net': https://patchwork.kernel.org/project/netdevbpf/patch/20220904215319.13070-1-ansuelsmth@gmail.com/
On Wednesday 14 September 2022 23:08:57 Vladimir Oltean wrote: > On Wed, Sep 14, 2022 at 10:06:41PM +0200, Pali Rohár wrote: > > Hello! This commit is causing kernel crash on powerpc P2020 based board > > with QCA8337N-AL3C switch. > > So function of_device_get_match_data() takes as its argument NULL > > pointer as 'priv' structure is at this stage zeroed, and which cause > > above kernel crash. priv->dev is filled lines below: > > Thanks for the report, it was solved in 'net': > https://patchwork.kernel.org/project/netdevbpf/patch/20220904215319.13070-1-ansuelsmth@gmail.com/ Ou, I did not know that there is already fix. Quick look did not found anything for qca8k_sw_probe. So sorry for the noise.
diff --git a/drivers/net/dsa/qca/qca8k-8xxx.c b/drivers/net/dsa/qca/qca8k-8xxx.c index 1d3e7782a71f..614950a5878a 100644 --- a/drivers/net/dsa/qca/qca8k-8xxx.c +++ b/drivers/net/dsa/qca/qca8k-8xxx.c @@ -1887,13 +1887,13 @@ qca8k_sw_probe(struct mdio_device *mdiodev) */ priv = devm_kzalloc(&mdiodev->dev, sizeof(*priv), GFP_KERNEL); if (!priv) return -ENOMEM; + priv->dev = &mdiodev->dev; priv->info = of_device_get_match_data(priv->dev); priv->bus = mdiodev->bus; - priv->dev = &mdiodev->dev; priv->reset_gpio = devm_gpiod_get_optional(priv->dev, "reset", GPIOD_ASIS); if (IS_ERR(priv->reset_gpio)) return PTR_ERR(priv->reset_gpio);