diff mbox series

ethernet: fman: fix wrong of_node_put() in probe function

Message ID 20181203122102.1400-1-nsaenzjulienne@suse.de
State Accepted, archived
Delegated to: David Miller
Headers show
Series ethernet: fman: fix wrong of_node_put() in probe function | expand

Commit Message

Nicolas Saenz Julienne Dec. 3, 2018, 12:21 p.m. UTC
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: 414fd46e7762 ("fsl/fman: Add FMan support")
Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
---
 drivers/net/ethernet/freescale/fman/fman.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

David Miller Dec. 5, 2018, 4:43 a.m. UTC | #1
From: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Date: Mon,  3 Dec 2018 13:21:01 +0100

> 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: 414fd46e7762 ("fsl/fman: Add FMan support")
> Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>

Applied, thank you.
diff mbox series

Patch

diff --git a/drivers/net/ethernet/freescale/fman/fman.c b/drivers/net/ethernet/freescale/fman/fman.c
index c415ac67cb7b..e80fedb27cee 100644
--- a/drivers/net/ethernet/freescale/fman/fman.c
+++ b/drivers/net/ethernet/freescale/fman/fman.c
@@ -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,
@@ -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);