Skip to content

Commit 45f1b02

Browse files
Wei Yongjundavem330
authored andcommitted
ethernet/arc/arc_emac: add missing platform_set_drvdata() in arc_emac_probe()
Add missing platform_set_drvdata() in arc_emac_probe(), otherwise calling platform_get_drvdata() in arc_emac_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 f8c31c8 commit 45f1b02

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/net/ethernet/arc/emac_main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -671,6 +671,7 @@ static int arc_emac_probe(struct platform_device *pdev)
671671
if (!ndev)
672672
return -ENOMEM;
673673

674+
platform_set_drvdata(pdev, ndev);
674675
SET_NETDEV_DEV(ndev, &pdev->dev);
675676

676677
ndev->netdev_ops = &arc_emac_netdev_ops;

0 commit comments

Comments
 (0)