Skip to contentSkip to conversation

Input: sparcspkr add of_node_put()

PATCH In review Yangtao Li 1 participant 2 messages Nov 21, 2018 – Dec 9, 2018

Subsystems (2)
lore
Share & tools
lore

Yangtao Li

author
#0 lore raw

PATCH 1/1 Input: sparcspkr add of_node_put()

of_find_node_by_path() acquires a reference to the node returned by it and that reference needs to be dropped by its caller. bl_idle_init() doesn't do that, so fix it.

---
 drivers/input/misc/sparcspkr.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/input/misc/sparcspkr.c +6 -3
index 4a5afc7fe96e..dc121fbbd3e1 100644
@@ -205,11 +205,11 @@ static int bbc_beep_probe(struct platform_device *op)
 	info = &state->u.bbc;
 	info->clock_freq = of_getintprop_default(dp, "clock-frequency", 0);
 	if (!info->clock_freq)
-		goto out_free;
+		goto out_put_node;
 
 	info->regs = of_ioremap(&op->resource[0], 0, 6, "bbc beep");
 	if (!info->regs)
-		goto out_free;
+		goto out_put_node;
 
 	platform_set_drvdata(op, state);
 
@@ -217,11 +217,14 @@ static int bbc_beep_probe(struct platform_device *op)
 	if (err)
 		goto out_clear_drvdata;
 
+	of_node_put(dp);
+
 	return 0;
 
 out_clear_drvdata:
 	of_iounmap(&op->resource[0], info->regs, 6);
-
+out_put_node:
+	of_node_put(dp);
 out_free:
 	kfree(state);
 out_err:
Signature · 1 line
2.17.0