Re: [PATCH v2] media: mdp3: Fix resource leak in a for_each_child_of_node() loop

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

 



Il 19/07/23 12:01, 路红飞 ha scritto:
for_each_child_of_node should have of_node_put()
in error path avoid resource leaks.

Signed-off-by: Lu Hongfei <luhongfei@xxxxxxxx>

That's still HTML; please avoid Cc'ing a bunch of people if you're testing
your email sendout.

Please test internally and once working send it again.

Btw, the code looks good... but I can't give you a R-b because of HTML format.

Thanks,
Angelo

---
Changelog:
v1->v2:
1. Change the subject line of this patch to include driver name.
2. Remove the unneeded of_node_put.

  drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c | 1 +
  1 file changed, 1 insertion(+)

diff --git a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c
index a605e80c7dc3..40c4b79a5090 100644
--- a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c
+++ b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c
@@ -1135,6 +1135,7 @@ int mdp_comp_config(struct mdp_dev *mdp)
  		comp = mdp_comp_create(mdp, node, id);
  		if (IS_ERR(comp)) {
  			ret = PTR_ERR(comp);
+			of_node_put(node);
  			goto err_init_comps;
  		}





[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux