Re: [PATCH 1/1] input: touchscreen: ts4800-ts: add missing of_node_put after calling of_parse_phandle

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jul 15, 2016 at 05:32:05PM +0800, Peter Chen wrote:
> of_node_put needs to be called when the device node which is got
> from of_parse_phandle has finished using.
> 
> Cc: linux-input@xxxxxxxxxxxxxxx
> Cc: Rob Herring <robh@xxxxxxxxxx>
> Cc: Damien Riegel <damien.riegel@xxxxxxxxxxxxxxxxxxxx>
> Cc: Dmitry Torokhov <dmitry.torokhov@xxxxxxxxx>
> Signed-off-by: Peter Chen <peter.chen@xxxxxxx>
> ---
>  drivers/input/touchscreen/ts4800-ts.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/input/touchscreen/ts4800-ts.c b/drivers/input/touchscreen/ts4800-ts.c
> index 3c3dd78..8f27ad8 100644
> --- a/drivers/input/touchscreen/ts4800-ts.c
> +++ b/drivers/input/touchscreen/ts4800-ts.c
> @@ -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.

>  	if (IS_ERR(ts->regmap)) {
>  		dev_err(dev, "cannot get parent's regmap\n");
>  		return PTR_ERR(ts->regmap);
> -- 
> 1.9.1
> 

Thanks.

-- 
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux