Skip to content

Commit

Permalink
ethernet: fman: fix wrong of_node_put() in probe function
Browse files Browse the repository at this point in the history
After getting a reference to the platform device's of_node the probe
function ends up calling of_find_matching_node() using the node as an
argument. The function takes care of decreasing the refcount on it. We
are then incorrectly decreasing the refcount on that node again.

This patch removes the unwarranted call to of_node_put().

Fixes: 414fd46 ("fsl/fman: Add FMan support")
Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Nicolas Saenz Julienne authored and David S. Miller committed Dec 5, 2018
1 parent 6888389 commit ecb239d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/net/ethernet/freescale/fman/fman.c
Original file line number Diff line number Diff line change
Expand Up @@ -2786,7 +2786,7 @@ static struct fman *read_dts_node(struct platform_device *of_dev)
if (!muram_node) {
dev_err(&of_dev->dev, "%s: could not find MURAM node\n",
__func__);
goto fman_node_put;
goto fman_free;
}

err = of_address_to_resource(muram_node, 0,
Expand All @@ -2795,11 +2795,10 @@ static struct fman *read_dts_node(struct platform_device *of_dev)
of_node_put(muram_node);
dev_err(&of_dev->dev, "%s: of_address_to_resource() = %d\n",
__func__, err);
goto fman_node_put;
goto fman_free;
}

of_node_put(muram_node);
of_node_put(fm_node);

err = devm_request_irq(&of_dev->dev, irq, fman_irq, IRQF_SHARED,
"fman", fman);
Expand Down

0 comments on commit ecb239d

Please sign in to comment.