On Fri Jun 19 13:41:30 2026 +0530, Biren Pandya wrote:
> In v4l2_fwnode_parse_link(), the remote endpoint fwnode reference is
> acquired using fwnode_graph_get_remote_endpoint(). This reference is
> properly released in the error paths, but it is leaked on the success
> path.
> 
> Add the missing fwnode_handle_put() before returning 0 to prevent the
> reference leak.
> 
> Signed-off-by: Biren Pandya <[email protected]>
> Fixes: ca50c197bd96 ("[media] v4l: fwnode: Support generic fwnode for parsing 
> standardised properties")
> Cc: [email protected]
> [Sakari Ailus: Fix subject prefix and coding style a little.]
> Signed-off-by: Sakari Ailus <[email protected]>

Patch committed.

Thanks,
Sakari Ailus

 drivers/media/v4l2-core/v4l2-fwnode.c | 2 ++
 1 file changed, 2 insertions(+)

---

diff --git a/drivers/media/v4l2-core/v4l2-fwnode.c 
b/drivers/media/v4l2-core/v4l2-fwnode.c
index 62a3a452f788..570df3c415b0 100644
--- a/drivers/media/v4l2-core/v4l2-fwnode.c
+++ b/drivers/media/v4l2-core/v4l2-fwnode.c
@@ -633,6 +633,8 @@ int v4l2_fwnode_parse_link(struct fwnode_handle *fwnode,
        if (!link->remote_node)
                goto err_put_remote_endpoint;
 
+       fwnode_handle_put(fwnode);
+
        return 0;
 
 err_put_remote_endpoint:
_______________________________________________
linuxtv-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to