Skip to content

Commit

Permalink
net: dsa: Add missing master netdev dev_put() calls
Browse files Browse the repository at this point in the history
Upon probe failure or unbinding, add missing dev_put() calls.

Signed-off-by: Neil Armstrong <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
superna9999 authored and davem330 committed Dec 7, 2015
1 parent b0dc635 commit 679fb46
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion net/dsa/dsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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)
Expand Down

0 comments on commit 679fb46

Please sign in to comment.