Commit 563e3051 authored by Alessandro Rubini's avatar Alessandro Rubini

kernel/wr_nic/device.c: parent of netdev is pdev (fixes oops)

This fixes an oops when programs access ethtool methods, especially
wrn_get_drvinfo. It can be reproduced by a simple run of "irqbalance",
which I never did in my development machine.
Reported-by: 's avatarGrzegorz Daniluk <grzegorz.daniluk@gmail.com>
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>

EOF
parent 903cd368
......@@ -158,6 +158,7 @@ static int __devinit wrn_probe(struct platform_device *pdev)
memset(wrn->dev, 0, sizeof(wrn->dev));
for (i = 0; i < WRN_NR_ENDPOINTS; i++) {
netdev = alloc_etherdev(sizeof(struct wrn_ep));
netdev->dev.parent = &pdev->dev;
if (!netdev) {
dev_err(&pdev->dev, "Etherdev alloc failed.\n");
err = -ENOMEM;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment