Skip to contentSkip to conversation

stmmac: fix setting of driver data in stmmac_dvr_probe

PATCH Applied Joachim Eastwood 2 participants 2 messages Jul 17, 2015 – Jul 21, 2015

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 stmmac: fix setting of driver data in stmmac_dvr_probe

Commit 803f8fc46274b ("stmmac: move driver data setting into stmmac_dvr_probe") mistakenly set priv and not priv->dev as driver data. This meant that the remove, resume and suspend callbacks that fetched and tried to use this data would most likely explode. Fix the issue by using the correct variable.

Fixes 803f8fc46274b ("stmmac: move driver data setting into stmmac_dvr_probe")

---
Hi,

I have no idea why I didn't notice (or anyone else for that matter) this issue before now. Looking at 803f8fc46274b it's pretty obvious and I should have spotted the mistake when I sent the orignal patch. Anyway it's good to get this fixed before 4.2 is released.

This should not conflict with any of the patches I sent for net-next, btw.

 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +1 -1
index 50f7a7a26821..864b476f7fd5 100644
@@ -2843,7 +2843,7 @@ int stmmac_dvr_probe(struct device *device,
 	if (res->mac)
 		memcpy(priv->dev->dev_addr, res->mac, ETH_ALEN);
 
-	dev_set_drvdata(device, priv);
+	dev_set_drvdata(device, priv->dev);
 
 	/* Verify driver arguments */
 	stmmac_verify_args();
Signature · 1 line
1.8.0
maintainer Applied
#1 lore raw

From: Joachim Eastwood <[email protected]>
Date: Fri, 17 Jul 2015 23:48:17 +0200

Quoted 8 lines

Commit 803f8fc46274b ("stmmac: move driver data setting into stmmac_dvr_probe") mistakenly set priv and not priv->dev as driver data. This meant that the remove, resume and suspend callbacks that fetched and tried to use this data would most likely explode. Fix the issue by using the correct variable.

Fixes 803f8fc46274b ("stmmac: move driver data setting into stmmac_dvr_probe")

Applied, thanks.