Skip to content

Commit 06a2feb

Browse files
Wei Yongjundavem330
authored andcommitted
macmace: add missing platform_set_drvdata() in mace_probe()
Add missing platform_set_drvdata() in mace_probe(), otherwise calling platform_get_drvdata() in mac_mace_device_remove() may returns NULL. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 45f1b02 commit 06a2feb

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/net/ethernet/apple/macmace.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ static int mace_probe(struct platform_device *pdev)
211211
mp = netdev_priv(dev);
212212

213213
mp->device = &pdev->dev;
214+
platform_set_drvdata(pdev, dev);
214215
SET_NETDEV_DEV(dev, &pdev->dev);
215216

216217
dev->base_addr = (u32)MACE_BASE;

0 commit comments

Comments
 (0)