diff mbox series

[v2,1/2] drm/ingenic: Fix leak of device_node pointer

Message ID 20200827114404.36748-1-paul@crapouillou.net (mailing list archive)
State New, archived
Headers show
Series [v2,1/2] drm/ingenic: Fix leak of device_node pointer | expand

Commit Message

Paul Cercueil Aug. 27, 2020, 11:44 a.m. UTC
of_graph_get_remote_node() requires of_node_put() to be called on the
device_node pointer when it's no more in use.

Fixes: fc1acf317b01 ("drm/ingenic: Add support for the IPU")
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---
 drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Sam Ravnborg Aug. 29, 2020, 9:07 p.m. UTC | #1
On Thu, Aug 27, 2020 at 01:44:03PM +0200, Paul Cercueil wrote:
> of_graph_get_remote_node() requires of_node_put() to be called on the
> device_node pointer when it's no more in use.
> 
> Fixes: fc1acf317b01 ("drm/ingenic: Add support for the IPU")
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
> ---
>  drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
> index ada990a7f911..c1bcb93aed2d 100644
> --- a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
> +++ b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
> @@ -978,6 +978,7 @@ static int ingenic_drm_probe(struct platform_device *pdev)
>  	}
>  
>  	drm_of_component_match_add(dev, &match, compare_of, np);
> +	of_node_put(np);
>  
>  	return component_master_add_with_match(dev, &ingenic_master_ops, match);
>  }
> -- 
> 2.28.0
Paul Cercueil Aug. 30, 2020, 10:55 p.m. UTC | #2
Hi Sam,

Le sam. 29 août 2020 à 23:07, Sam Ravnborg <sam@ravnborg.org> a 
écrit :
> On Thu, Aug 27, 2020 at 01:44:03PM +0200, Paul Cercueil wrote:
>>  of_graph_get_remote_node() requires of_node_put() to be called on 
>> the
>>  device_node pointer when it's no more in use.
>> 
>>  Fixes: fc1acf317b01 ("drm/ingenic: Add support for the IPU")
>>  Signed-off-by: Paul Cercueil <paul@crapouillou.net>
> Reviewed-by: Sam Ravnborg <sam@ravnborg.org>

Thanks. Both patches pushed to drm-misc-fixes.

Cheers,
-Paul

>>  ---
>>   drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 1 +
>>   1 file changed, 1 insertion(+)
>> 
>>  diff --git a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c 
>> b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
>>  index ada990a7f911..c1bcb93aed2d 100644
>>  --- a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
>>  +++ b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
>>  @@ -978,6 +978,7 @@ static int ingenic_drm_probe(struct 
>> platform_device *pdev)
>>   	}
>> 
>>   	drm_of_component_match_add(dev, &match, compare_of, np);
>>  +	of_node_put(np);
>> 
>>   	return component_master_add_with_match(dev, &ingenic_master_ops, 
>> match);
>>   }
>>  --
>>  2.28.0
diff mbox series

Patch

diff --git a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
index ada990a7f911..c1bcb93aed2d 100644
--- a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
+++ b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
@@ -978,6 +978,7 @@  static int ingenic_drm_probe(struct platform_device *pdev)
 	}
 
 	drm_of_component_match_add(dev, &match, compare_of, np);
+	of_node_put(np);
 
 	return component_master_add_with_match(dev, &ingenic_master_ops, match);
 }