diff mbox

[1/3] drm/msm: dsi host: add missing of_node_put()

Message ID 1434984861-22948-2-git-send-email-architt@codeaurora.org (mailing list archive)
State Not Applicable, archived
Delegated to: Andy Gross
Headers show

Commit Message

Archit Taneja June 22, 2015, 2:54 p.m. UTC
Decrement device node refcount if of_get_child_by_name is successfully
called.

Signed-off-by: Archit Taneja <architt@codeaurora.org>
---
 drivers/gpu/drm/msm/dsi/dsi_host.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Srinivas Kandagatla June 22, 2015, 4 p.m. UTC | #1
On 22/06/15 15:54, Archit Taneja wrote:
> Decrement device node refcount if of_get_child_by_name is successfully
> called.
>
> Signed-off-by: Archit Taneja <architt@codeaurora.org>
> ---
>   drivers/gpu/drm/msm/dsi/dsi_host.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c
> index de04009..1751659 100644
> --- a/drivers/gpu/drm/msm/dsi/dsi_host.c
> +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c
> @@ -1582,6 +1582,8 @@ int msm_dsi_host_register(struct mipi_dsi_host *host, bool check_defer)
>   			node = of_get_child_by_name(msm_host->pdev->dev.of_node,
>   							"panel");
>   			if (node) {
> +				of_node_put(node);
> +

Atleast from the current state of code, It looks like the driver is 
going to refer to the node of_node_put?, So I think this is not the 
right place to have of_node_put.



  >   				if (!of_drm_find_panel(node))
>   					return -EPROBE_DEFER;
>   			}
>
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
Archit Taneja June 23, 2015, 5:02 a.m. UTC | #2
On 06/22/2015 09:30 PM, Srinivas Kandagatla wrote:
>
>
> On 22/06/15 15:54, Archit Taneja wrote:
>> Decrement device node refcount if of_get_child_by_name is successfully
>> called.
>>
>> Signed-off-by: Archit Taneja <architt@codeaurora.org>
>> ---
>>   drivers/gpu/drm/msm/dsi/dsi_host.c | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c
>> b/drivers/gpu/drm/msm/dsi/dsi_host.c
>> index de04009..1751659 100644
>> --- a/drivers/gpu/drm/msm/dsi/dsi_host.c
>> +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c
>> @@ -1582,6 +1582,8 @@ int msm_dsi_host_register(struct mipi_dsi_host
>> *host, bool check_defer)
>>               node = of_get_child_by_name(msm_host->pdev->dev.of_node,
>>                               "panel");
>>               if (node) {
>> +                of_node_put(node);
>> +
>
> Atleast from the current state of code, It looks like the driver is
> going to refer to the node of_node_put?, So I think this is not the
> right place to have of_node_put.

That's right. I made the same mistake in the later patches too. I'll fix 
these.

Thanks,
Archit
diff mbox

Patch

diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c
index de04009..1751659 100644
--- a/drivers/gpu/drm/msm/dsi/dsi_host.c
+++ b/drivers/gpu/drm/msm/dsi/dsi_host.c
@@ -1582,6 +1582,8 @@  int msm_dsi_host_register(struct mipi_dsi_host *host, bool check_defer)
 			node = of_get_child_by_name(msm_host->pdev->dev.of_node,
 							"panel");
 			if (node) {
+				of_node_put(node);
+
 				if (!of_drm_find_panel(node))
 					return -EPROBE_DEFER;
 			}