提交 679fb46c 编写于 作者: N Neil Armstrong 提交者: David S. Miller

net: dsa: Add missing master netdev dev_put() calls

Upon probe failure or unbinding, add missing dev_put() calls.
Signed-off-by: NNeil Armstrong <narmstrong@baylibre.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 b0dc635d
......@@ -919,8 +919,10 @@ static int dsa_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, dst);
ret = dsa_setup_dst(dst, dev, &pdev->dev, pd);
if (ret)
if (ret) {
dev_put(dev);
goto out;
}
return 0;
......@@ -940,6 +942,8 @@ static void dsa_remove_dst(struct dsa_switch_tree *dst)
if (ds)
dsa_switch_destroy(ds);
}
dev_put(dst->master_netdev);
}
static int dsa_remove(struct platform_device *pdev)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册