netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Fabio Estevam <festevam@gmail.com>
To: kuba@kernel.org
Cc: davem@davemloft.net, andrew@lunn.ch,
	claudiu.beznea@microchip.com, netdev@vger.kernel.org,
	o.rempel@pengutronix.de, linux@armlinux.org.uk,
	Fabio Estevam <festevam@denx.de>,
	stable@vger.kernel.org
Subject: [PATCH net v2 2/2] net: phy: micrel: Pass .probe for KS8737
Date: Wed,  4 May 2022 11:31:04 -0300	[thread overview]
Message-ID: <20220504143104.1286960-2-festevam@gmail.com> (raw)
In-Reply-To: <20220504143104.1286960-1-festevam@gmail.com>

From: Fabio Estevam <festevam@denx.de>

Since commit f1131b9c23fb ("net: phy: micrel: use
kszphy_suspend()/kszphy_resume for irq aware devices") the kszphy_suspend/
resume hooks are used.

These functions require the probe function to be called so that
priv can be allocated.

Otherwise, a NULL pointer dereference happens inside
kszphy_config_reset().

Cc: stable@vger.kernel.org
Fixes: f1131b9c23fb ("net: phy: micrel: use kszphy_suspend()/kszphy_resume for irq aware devices")
Reported-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Fabio Estevam <festevam@denx.de>
---
Changes since v1:
- Newly introduced. This was noticed by Andrew.

 drivers/net/phy/micrel.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
index 11cd073630e5..a06661c07ca8 100644
--- a/drivers/net/phy/micrel.c
+++ b/drivers/net/phy/micrel.c
@@ -2896,6 +2896,7 @@ static struct phy_driver ksphy_driver[] = {
 	.name		= "Micrel KS8737",
 	/* PHY_BASIC_FEATURES */
 	.driver_data	= &ks8737_type,
+	.probe		= kszphy_probe,
 	.config_init	= kszphy_config_init,
 	.config_intr	= kszphy_config_intr,
 	.handle_interrupt = kszphy_handle_interrupt,
-- 
2.25.1


  reply	other threads:[~2022-05-04 14:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-04 14:31 [PATCH net v2 1/2] net: phy: micrel: Do not use kszphy_suspend/resume for KSZ8061 Fabio Estevam
2022-05-04 14:31 ` Fabio Estevam [this message]
2022-05-04 21:52   ` [PATCH net v2 2/2] net: phy: micrel: Pass .probe for KS8737 Andrew Lunn
2022-05-04 17:03 ` [PATCH net v2 1/2] net: phy: micrel: Do not use kszphy_suspend/resume for KSZ8061 Fabio Estevam
2022-05-04 21:53   ` Andrew Lunn
2022-05-04 21:51 ` Andrew Lunn
2022-05-06  1:20 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220504143104.1286960-2-festevam@gmail.com \
    --to=festevam@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=claudiu.beznea@microchip.com \
    --cc=davem@davemloft.net \
    --cc=festevam@denx.de \
    --cc=kuba@kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=o.rempel@pengutronix.de \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).