input: touchscreen: ts4800-ts: add missing of_node_put after calling of_parse_phandle
Subsystems (2)
PATCH 1/1 input: touchscreen: ts4800-ts: add missing of_node_put after calling of_parse_phandle
of_node_put needs to be called when the device node which is got from of_parse_phandle has finished using.
Cc Rob Herring <[email protected]>
Cc Damien Riegel <[email protected]>
Cc Dmitry Torokhov <[email protected]>
Signed-off-by Peter Chen <[email protected]>
--- drivers/input/touchscreen/ts4800-ts.c | 1 + 1 file changed, 1 insertion(+)
drivers/input/touchscreen/ts4800-ts.c +1 -0
@@ -135,6 +135,7 @@ static int ts4800_parse_dt(struct platform_device *pdev, ts->bit =BIT (bit); ts->regmap =syscon_node_to_regmap (syscon_np); +of_node_put (syscon_np);if (IS_ERR (ts->regmap)) {dev_err (dev,"cannot get parent's regmap\n" );return PTR_ERR (ts->regmap);
Signature · 1 line
1.9.1
Dmitry Torokhov
maintainerQuoted 17 lines · Peter Chen
of_node_putneeds to be called when the device node which is got fromof_parse_phandlehas finished using.Cc Rob Herring <[email protected]>Cc Damien Riegel <[email protected]>Cc Dmitry Torokhov <[email protected]>Signed-off-by Peter Chen <[email protected]>--- drivers/input/touchscreen/ts4800-ts.c | 1 + 1 file changed, 1 insertion(+)drivers/input/touchscreen/ts4800-ts.c +0
-0
drivers/input/touchscreen/ts4800-ts.c static int ts4800_parse_dt(struct platform_device *pdev, · line 138
Quoted 4 lines
drivers/input/touchscreen/ts4800-ts.c +1
-0@@ -135,6 +135,7 @@ static int ts4800_parse_dt(struct platform_device *pdev, ts->bit =BIT (bit); ts->regmap =syscon_node_to_regmap (syscon_np); +of_node_put (syscon_np);
This does not help with the other 2 "returns" above which also leak the reference count. I'll switch the code around and apply.
Quoted 6 lines
drivers/input/touchscreen/ts4800-ts.c +0
-0if (IS_ERR (ts->regmap)) {dev_err (dev,"cannot get parent's regmap\n" );return PTR_ERR (ts->regmap);Signature · 1 line
1.9.1
Thanks.
Signature · 1 line
Dmitry