* [PATCH v2] drm: rcar-du: Fix memory leak in rcar_du_vsps_init()
@ 2023-11-16 12:24 Biju Das
2023-12-15 9:15 ` Biju Das
2023-12-18 10:39 ` Laurent Pinchart
0 siblings, 2 replies; 9+ messages in thread
From: Biju Das @ 2023-11-16 12:24 UTC (permalink / raw)
To: David Airlie, Daniel Vetter
Cc: Biju Das, Laurent Pinchart, Kieran Bingham, Jacopo Mondi,
dri-devel, linux-renesas-soc, Geert Uytterhoeven,
Prabhakar Mahadev Lad, Biju Das
The rcar_du_vsps_init() doesn't free the np allocated by
of_parse_phandle_with_fixed_args() for the non-error case.
Fix memory leak for the non-error case.
While at it, replace the label 'error'->'done' as it applies to non-error
case as well and update the error check condition for rcar_du_vsp_init()
to avoid breakage in future, if it returns positive value.
Fixes: 3e81374e2014 ("drm: rcar-du: Support multiple sources from the same VSP")
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
v1->v2:
* Replaced the label 'error'->'done' as it applies to non-error case as
well.
* Update the error check condition for rcar_du_vsp_init() to avoid
breakage in future, if it returns positive value.
---
drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c
index 70d8ad065bfa..4c8fe83dd610 100644
--- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c
+++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c
@@ -705,7 +705,7 @@ static int rcar_du_vsps_init(struct rcar_du_device *rcdu)
ret = of_parse_phandle_with_fixed_args(np, vsps_prop_name,
cells, i, &args);
if (ret < 0)
- goto error;
+ goto done;
/*
* Add the VSP to the list or update the corresponding existing
@@ -743,13 +743,11 @@ static int rcar_du_vsps_init(struct rcar_du_device *rcdu)
vsp->dev = rcdu;
ret = rcar_du_vsp_init(vsp, vsps[i].np, vsps[i].crtcs_mask);
- if (ret < 0)
- goto error;
+ if (ret)
+ goto done;
}
- return 0;
-
-error:
+done:
for (i = 0; i < ARRAY_SIZE(vsps); ++i)
of_node_put(vsps[i].np);
--
2.25.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* RE: [PATCH v2] drm: rcar-du: Fix memory leak in rcar_du_vsps_init()
2023-11-16 12:24 [PATCH v2] drm: rcar-du: Fix memory leak in rcar_du_vsps_init() Biju Das
@ 2023-12-15 9:15 ` Biju Das
2023-12-18 10:39 ` Laurent Pinchart
1 sibling, 0 replies; 9+ messages in thread
From: Biju Das @ 2023-12-15 9:15 UTC (permalink / raw)
To: David Airlie, Daniel Vetter
Cc: Laurent Pinchart, Kieran Bingham, Jacopo Mondi,
dri-devel@lists.freedesktop.org,
linux-renesas-soc@vger.kernel.org, Geert Uytterhoeven,
Prabhakar Mahadev Lad, biju.das.au
Hi All,
Gentle ping.
> -----Original Message-----
> From: Biju Das <biju.das.jz@bp.renesas.com>
> Sent: Thursday, November 16, 2023 12:24 PM
> Subject: [PATCH v2] drm: rcar-du: Fix memory leak in rcar_du_vsps_init()
>
> The rcar_du_vsps_init() doesn't free the np allocated by
> of_parse_phandle_with_fixed_args() for the non-error case.
>
> Fix memory leak for the non-error case.
>
> While at it, replace the label 'error'->'done' as it applies to non-error
> case as well and update the error check condition for rcar_du_vsp_init()
> to avoid breakage in future, if it returns positive value.
>
> Fixes: 3e81374e2014 ("drm: rcar-du: Support multiple sources from the same
> VSP")
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> ---
> v1->v2:
> * Replaced the label 'error'->'done' as it applies to non-error case as
> well.
> * Update the error check condition for rcar_du_vsp_init() to avoid
> breakage in future, if it returns positive value.
> ---
> drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c | 10 ++++------
> 1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c
> b/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c
> index 70d8ad065bfa..4c8fe83dd610 100644
> --- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c
> +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c
> @@ -705,7 +705,7 @@ static int rcar_du_vsps_init(struct rcar_du_device
> *rcdu)
> ret = of_parse_phandle_with_fixed_args(np, vsps_prop_name,
> cells, i, &args);
> if (ret < 0)
> - goto error;
> + goto done;
>
> /*
> * Add the VSP to the list or update the corresponding
> existing @@ -743,13 +743,11 @@ static int rcar_du_vsps_init(struct
> rcar_du_device *rcdu)
> vsp->dev = rcdu;
>
> ret = rcar_du_vsp_init(vsp, vsps[i].np, vsps[i].crtcs_mask);
> - if (ret < 0)
> - goto error;
> + if (ret)
> + goto done;
> }
>
> - return 0;
> -
> -error:
> +done:
> for (i = 0; i < ARRAY_SIZE(vsps); ++i)
> of_node_put(vsps[i].np);
>
> --
> 2.25.1
Cheers,
Biju
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2] drm: rcar-du: Fix memory leak in rcar_du_vsps_init()
2023-11-16 12:24 [PATCH v2] drm: rcar-du: Fix memory leak in rcar_du_vsps_init() Biju Das
2023-12-15 9:15 ` Biju Das
@ 2023-12-18 10:39 ` Laurent Pinchart
2024-01-04 11:04 ` Biju Das
2024-08-27 16:43 ` Biju Das
1 sibling, 2 replies; 9+ messages in thread
From: Laurent Pinchart @ 2023-12-18 10:39 UTC (permalink / raw)
To: Biju Das
Cc: David Airlie, Daniel Vetter, Kieran Bingham, Jacopo Mondi,
dri-devel, linux-renesas-soc, Geert Uytterhoeven,
Prabhakar Mahadev Lad, Biju Das
Hi Biju,
Thank you for the patch.
On Thu, Nov 16, 2023 at 12:24:24PM +0000, Biju Das wrote:
> The rcar_du_vsps_init() doesn't free the np allocated by
> of_parse_phandle_with_fixed_args() for the non-error case.
>
> Fix memory leak for the non-error case.
>
> While at it, replace the label 'error'->'done' as it applies to non-error
> case as well and update the error check condition for rcar_du_vsp_init()
> to avoid breakage in future, if it returns positive value.
>
> Fixes: 3e81374e2014 ("drm: rcar-du: Support multiple sources from the same VSP")
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> ---
> v1->v2:
> * Replaced the label 'error'->'done' as it applies to non-error case as
> well.
> * Update the error check condition for rcar_du_vsp_init() to avoid
> breakage in future, if it returns positive value.
> ---
> drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c | 10 ++++------
> 1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c
> index 70d8ad065bfa..4c8fe83dd610 100644
> --- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c
> +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c
> @@ -705,7 +705,7 @@ static int rcar_du_vsps_init(struct rcar_du_device *rcdu)
> ret = of_parse_phandle_with_fixed_args(np, vsps_prop_name,
> cells, i, &args);
> if (ret < 0)
> - goto error;
> + goto done;
>
> /*
> * Add the VSP to the list or update the corresponding existing
> @@ -743,13 +743,11 @@ static int rcar_du_vsps_init(struct rcar_du_device *rcdu)
> vsp->dev = rcdu;
>
> ret = rcar_du_vsp_init(vsp, vsps[i].np, vsps[i].crtcs_mask);
> - if (ret < 0)
> - goto error;
> + if (ret)
> + goto done;
> }
>
> - return 0;
> -
> -error:
> +done:
> for (i = 0; i < ARRAY_SIZE(vsps); ++i)
> of_node_put(vsps[i].np);
>
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: [PATCH v2] drm: rcar-du: Fix memory leak in rcar_du_vsps_init()
2023-12-18 10:39 ` Laurent Pinchart
@ 2024-01-04 11:04 ` Biju Das
2024-08-27 16:43 ` Biju Das
1 sibling, 0 replies; 9+ messages in thread
From: Biju Das @ 2024-01-04 11:04 UTC (permalink / raw)
To: Laurent Pinchart
Cc: David Airlie, Daniel Vetter, Kieran Bingham, Jacopo Mondi,
dri-devel@lists.freedesktop.org,
linux-renesas-soc@vger.kernel.org, Geert Uytterhoeven,
Prabhakar Mahadev Lad, biju.das.au
Hi Laurent,
> Subject: Re: [PATCH v2] drm: rcar-du: Fix memory leak in
> rcar_du_vsps_init()
>
> Hi Biju,
>
> Thank you for the patch.
>
> On Thu, Nov 16, 2023 at 12:24:24PM +0000, Biju Das wrote:
> > The rcar_du_vsps_init() doesn't free the np allocated by
> > of_parse_phandle_with_fixed_args() for the non-error case.
> >
> > Fix memory leak for the non-error case.
> >
> > While at it, replace the label 'error'->'done' as it applies to
> > non-error case as well and update the error check condition for
> > rcar_du_vsp_init() to avoid breakage in future, if it returns positive
> value.
> >
> > Fixes: 3e81374e2014 ("drm: rcar-du: Support multiple sources from the
> > same VSP")
> > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
>
> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Can it be applied to rcar-du tree as in MAINTAINERS entry? Or it has to go through drm-misc-next?
Cheers,
Biju
>
> > ---
> > v1->v2:
> > * Replaced the label 'error'->'done' as it applies to non-error case as
> > well.
> > * Update the error check condition for rcar_du_vsp_init() to avoid
> > breakage in future, if it returns positive value.
> > ---
> > drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c | 10 ++++------
> > 1 file changed, 4 insertions(+), 6 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c
> > b/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c
> > index 70d8ad065bfa..4c8fe83dd610 100644
> > --- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c
> > +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c
> > @@ -705,7 +705,7 @@ static int rcar_du_vsps_init(struct rcar_du_device
> *rcdu)
> > ret = of_parse_phandle_with_fixed_args(np, vsps_prop_name,
> > cells, i, &args);
> > if (ret < 0)
> > - goto error;
> > + goto done;
> >
> > /*
> > * Add the VSP to the list or update the corresponding
> existing @@
> > -743,13 +743,11 @@ static int rcar_du_vsps_init(struct rcar_du_device
> *rcdu)
> > vsp->dev = rcdu;
> >
> > ret = rcar_du_vsp_init(vsp, vsps[i].np, vsps[i].crtcs_mask);
> > - if (ret < 0)
> > - goto error;
> > + if (ret)
> > + goto done;
> > }
> >
> > - return 0;
> > -
> > -error:
> > +done:
> > for (i = 0; i < ARRAY_SIZE(vsps); ++i)
> > of_node_put(vsps[i].np);
> >
>
> --
> Regards,
>
> Laurent Pinchart
^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: [PATCH v2] drm: rcar-du: Fix memory leak in rcar_du_vsps_init()
2023-12-18 10:39 ` Laurent Pinchart
2024-01-04 11:04 ` Biju Das
@ 2024-08-27 16:43 ` Biju Das
2024-08-27 22:22 ` Laurent Pinchart
1 sibling, 1 reply; 9+ messages in thread
From: Biju Das @ 2024-08-27 16:43 UTC (permalink / raw)
To: Laurent Pinchart, Tomi Valkeinen
Cc: David Airlie, Daniel Vetter, Kieran Bingham, Jacopo Mondi,
dri-devel@lists.freedesktop.org,
linux-renesas-soc@vger.kernel.org, Geert Uytterhoeven,
Prabhakar Mahadev Lad, biju.das.au
Hi Laurent and Tomi,
Gentle ping. Are you happy with this patch?
Cheers,
Biju
> -----Original Message-----
> From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Sent: Monday, December 18, 2023 10:39 AM
> Subject: Re: [PATCH v2] drm: rcar-du: Fix memory leak in rcar_du_vsps_init()
>
> Hi Biju,
>
> Thank you for the patch.
>
> On Thu, Nov 16, 2023 at 12:24:24PM +0000, Biju Das wrote:
> > The rcar_du_vsps_init() doesn't free the np allocated by
> > of_parse_phandle_with_fixed_args() for the non-error case.
> >
> > Fix memory leak for the non-error case.
> >
> > While at it, replace the label 'error'->'done' as it applies to
> > non-error case as well and update the error check condition for
> > rcar_du_vsp_init() to avoid breakage in future, if it returns positive value.
> >
> > Fixes: 3e81374e2014 ("drm: rcar-du: Support multiple sources from the
> > same VSP")
> > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
>
> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
>
> > ---
> > v1->v2:
> > * Replaced the label 'error'->'done' as it applies to non-error case as
> > well.
> > * Update the error check condition for rcar_du_vsp_init() to avoid
> > breakage in future, if it returns positive value.
> > ---
> > drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c | 10 ++++------
> > 1 file changed, 4 insertions(+), 6 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c
> > b/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c
> > index 70d8ad065bfa..4c8fe83dd610 100644
> > --- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c
> > +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c
> > @@ -705,7 +705,7 @@ static int rcar_du_vsps_init(struct rcar_du_device *rcdu)
> > ret = of_parse_phandle_with_fixed_args(np, vsps_prop_name,
> > cells, i, &args);
> > if (ret < 0)
> > - goto error;
> > + goto done;
> >
> > /*
> > * Add the VSP to the list or update the corresponding existing @@
> > -743,13 +743,11 @@ static int rcar_du_vsps_init(struct rcar_du_device *rcdu)
> > vsp->dev = rcdu;
> >
> > ret = rcar_du_vsp_init(vsp, vsps[i].np, vsps[i].crtcs_mask);
> > - if (ret < 0)
> > - goto error;
> > + if (ret)
> > + goto done;
> > }
> >
> > - return 0;
> > -
> > -error:
> > +done:
> > for (i = 0; i < ARRAY_SIZE(vsps); ++i)
> > of_node_put(vsps[i].np);
> >
>
> --
> Regards,
>
> Laurent Pinchart
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2] drm: rcar-du: Fix memory leak in rcar_du_vsps_init()
2024-08-27 16:43 ` Biju Das
@ 2024-08-27 22:22 ` Laurent Pinchart
2024-08-28 5:54 ` Biju Das
2024-08-28 7:21 ` Biju Das
0 siblings, 2 replies; 9+ messages in thread
From: Laurent Pinchart @ 2024-08-27 22:22 UTC (permalink / raw)
To: Biju Das
Cc: Tomi Valkeinen, David Airlie, Daniel Vetter, Kieran Bingham,
Jacopo Mondi, dri-devel@lists.freedesktop.org,
linux-renesas-soc@vger.kernel.org, Geert Uytterhoeven,
Prabhakar Mahadev Lad, biju.das.au
Hi Biju,
On Tue, Aug 27, 2024 at 04:43:12PM +0000, Biju Das wrote:
> Hi Laurent and Tomi,
>
> Gentle ping. Are you happy with this patch?
I've sent a pull request last Friday, see
https://lore.kernel.org/r/20240822234445.GA23541@pendragon.ideasonboard.com
> > -----Original Message-----
> > From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > Sent: Monday, December 18, 2023 10:39 AM
> > Subject: Re: [PATCH v2] drm: rcar-du: Fix memory leak in rcar_du_vsps_init()
> >
> > Hi Biju,
> >
> > Thank you for the patch.
> >
> > On Thu, Nov 16, 2023 at 12:24:24PM +0000, Biju Das wrote:
> > > The rcar_du_vsps_init() doesn't free the np allocated by
> > > of_parse_phandle_with_fixed_args() for the non-error case.
> > >
> > > Fix memory leak for the non-error case.
> > >
> > > While at it, replace the label 'error'->'done' as it applies to
> > > non-error case as well and update the error check condition for
> > > rcar_du_vsp_init() to avoid breakage in future, if it returns positive value.
> > >
> > > Fixes: 3e81374e2014 ("drm: rcar-du: Support multiple sources from the
> > > same VSP")
> > > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> >
> > Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> >
> > > ---
> > > v1->v2:
> > > * Replaced the label 'error'->'done' as it applies to non-error case as
> > > well.
> > > * Update the error check condition for rcar_du_vsp_init() to avoid
> > > breakage in future, if it returns positive value.
> > > ---
> > > drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c | 10 ++++------
> > > 1 file changed, 4 insertions(+), 6 deletions(-)
> > >
> > > diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c
> > > b/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c
> > > index 70d8ad065bfa..4c8fe83dd610 100644
> > > --- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c
> > > +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c
> > > @@ -705,7 +705,7 @@ static int rcar_du_vsps_init(struct rcar_du_device *rcdu)
> > > ret = of_parse_phandle_with_fixed_args(np, vsps_prop_name,
> > > cells, i, &args);
> > > if (ret < 0)
> > > - goto error;
> > > + goto done;
> > >
> > > /*
> > > * Add the VSP to the list or update the corresponding existing @@
> > > -743,13 +743,11 @@ static int rcar_du_vsps_init(struct rcar_du_device *rcdu)
> > > vsp->dev = rcdu;
> > >
> > > ret = rcar_du_vsp_init(vsp, vsps[i].np, vsps[i].crtcs_mask);
> > > - if (ret < 0)
> > > - goto error;
> > > + if (ret)
> > > + goto done;
> > > }
> > >
> > > - return 0;
> > > -
> > > -error:
> > > +done:
> > > for (i = 0; i < ARRAY_SIZE(vsps); ++i)
> > > of_node_put(vsps[i].np);
> > >
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: [PATCH v2] drm: rcar-du: Fix memory leak in rcar_du_vsps_init()
2024-08-27 22:22 ` Laurent Pinchart
@ 2024-08-28 5:54 ` Biju Das
2024-08-28 7:21 ` Biju Das
1 sibling, 0 replies; 9+ messages in thread
From: Biju Das @ 2024-08-28 5:54 UTC (permalink / raw)
To: Laurent Pinchart
Cc: Tomi Valkeinen, David Airlie, Daniel Vetter, Kieran Bingham,
Jacopo Mondi, dri-devel@lists.freedesktop.org,
linux-renesas-soc@vger.kernel.org, Geert Uytterhoeven,
Prabhakar Mahadev Lad, biju.das.au
> -----Original Message-----
> From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Sent: Tuesday, August 27, 2024 11:23 PM
> Subject: Re: [PATCH v2] drm: rcar-du: Fix memory leak in rcar_du_vsps_init()
>
> Hi Biju,
>
> On Tue, Aug 27, 2024 at 04:43:12PM +0000, Biju Das wrote:
> > Hi Laurent and Tomi,
> >
> > Gentle ping. Are you happy with this patch?
>
> I've sent a pull request last Friday, see
> https://lore.kernel.org/r/20240822234445.GA23541@pendragon.ideasonboard.com
That is nice.
Thanks,
Biju
>
> > > -----Original Message-----
> > > From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > > Sent: Monday, December 18, 2023 10:39 AM
> > > Subject: Re: [PATCH v2] drm: rcar-du: Fix memory leak in
> > > rcar_du_vsps_init()
> > >
> > > Hi Biju,
> > >
> > > Thank you for the patch.
> > >
> > > On Thu, Nov 16, 2023 at 12:24:24PM +0000, Biju Das wrote:
> > > > The rcar_du_vsps_init() doesn't free the np allocated by
> > > > of_parse_phandle_with_fixed_args() for the non-error case.
> > > >
> > > > Fix memory leak for the non-error case.
> > > >
> > > > While at it, replace the label 'error'->'done' as it applies to
> > > > non-error case as well and update the error check condition for
> > > > rcar_du_vsp_init() to avoid breakage in future, if it returns positive value.
> > > >
> > > > Fixes: 3e81374e2014 ("drm: rcar-du: Support multiple sources from
> > > > the same VSP")
> > > > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> > >
> > > Reviewed-by: Laurent Pinchart
> > > <laurent.pinchart+renesas@ideasonboard.com>
> > >
> > > > ---
> > > > v1->v2:
> > > > * Replaced the label 'error'->'done' as it applies to non-error case as
> > > > well.
> > > > * Update the error check condition for rcar_du_vsp_init() to avoid
> > > > breakage in future, if it returns positive value.
> > > > ---
> > > > drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c | 10 ++++------
> > > > 1 file changed, 4 insertions(+), 6 deletions(-)
> > > >
> > > > diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c
> > > > b/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c
> > > > index 70d8ad065bfa..4c8fe83dd610 100644
> > > > --- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c
> > > > +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c
> > > > @@ -705,7 +705,7 @@ static int rcar_du_vsps_init(struct rcar_du_device *rcdu)
> > > > ret = of_parse_phandle_with_fixed_args(np, vsps_prop_name,
> > > > cells, i, &args);
> > > > if (ret < 0)
> > > > - goto error;
> > > > + goto done;
> > > >
> > > > /*
> > > > * Add the VSP to the list or update the corresponding existing
> > > > @@
> > > > -743,13 +743,11 @@ static int rcar_du_vsps_init(struct rcar_du_device *rcdu)
> > > > vsp->dev = rcdu;
> > > >
> > > > ret = rcar_du_vsp_init(vsp, vsps[i].np, vsps[i].crtcs_mask);
> > > > - if (ret < 0)
> > > > - goto error;
> > > > + if (ret)
> > > > + goto done;
> > > > }
> > > >
> > > > - return 0;
> > > > -
> > > > -error:
> > > > +done:
> > > > for (i = 0; i < ARRAY_SIZE(vsps); ++i)
> > > > of_node_put(vsps[i].np);
> > > >
>
> --
> Regards,
>
> Laurent Pinchart
^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: [PATCH v2] drm: rcar-du: Fix memory leak in rcar_du_vsps_init()
2024-08-27 22:22 ` Laurent Pinchart
2024-08-28 5:54 ` Biju Das
@ 2024-08-28 7:21 ` Biju Das
2024-08-29 13:52 ` Laurent Pinchart
1 sibling, 1 reply; 9+ messages in thread
From: Biju Das @ 2024-08-28 7:21 UTC (permalink / raw)
To: Laurent Pinchart
Cc: Tomi Valkeinen, David Airlie, Daniel Vetter, Kieran Bingham,
Jacopo Mondi, dri-devel@lists.freedesktop.org,
linux-renesas-soc@vger.kernel.org, Geert Uytterhoeven,
Prabhakar Mahadev Lad, biju.das.au
Hi Laurent,
> -----Original Message-----
> From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Sent: Tuesday, August 27, 2024 11:23 PM
> Subject: Re: [PATCH v2] drm: rcar-du: Fix memory leak in rcar_du_vsps_init()
>
> Hi Biju,
>
> On Tue, Aug 27, 2024 at 04:43:12PM +0000, Biju Das wrote:
> > Hi Laurent and Tomi,
> >
> > Gentle ping. Are you happy with this patch?
>
> I've sent a pull request last Friday, see
> https://lore.kernel.org/r/20240822234445.GA23541@pendragon.ideasonboard.com
I believe the commit[1] won't apply any more as the source location is moved.
Shall I resend the patch or You will take care, please let me know.
[1]
https://git.kernel.org/pub/scm/linux/kernel/git/pinchartl/linux.git/commit/?h=drm-next-20240823&id=866dfbc953d46cf7682c6a434a4dd6249677fd68
Cheers,
Biju
>
> > > -----Original Message-----
> > > From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > > Sent: Monday, December 18, 2023 10:39 AM
> > > Subject: Re: [PATCH v2] drm: rcar-du: Fix memory leak in
> > > rcar_du_vsps_init()
> > >
> > > Hi Biju,
> > >
> > > Thank you for the patch.
> > >
> > > On Thu, Nov 16, 2023 at 12:24:24PM +0000, Biju Das wrote:
> > > > The rcar_du_vsps_init() doesn't free the np allocated by
> > > > of_parse_phandle_with_fixed_args() for the non-error case.
> > > >
> > > > Fix memory leak for the non-error case.
> > > >
> > > > While at it, replace the label 'error'->'done' as it applies to
> > > > non-error case as well and update the error check condition for
> > > > rcar_du_vsp_init() to avoid breakage in future, if it returns positive value.
> > > >
> > > > Fixes: 3e81374e2014 ("drm: rcar-du: Support multiple sources from
> > > > the same VSP")
> > > > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> > >
> > > Reviewed-by: Laurent Pinchart
> > > <laurent.pinchart+renesas@ideasonboard.com>
> > >
> > > > ---
> > > > v1->v2:
> > > > * Replaced the label 'error'->'done' as it applies to non-error case as
> > > > well.
> > > > * Update the error check condition for rcar_du_vsp_init() to avoid
> > > > breakage in future, if it returns positive value.
> > > > ---
> > > > drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c | 10 ++++------
> > > > 1 file changed, 4 insertions(+), 6 deletions(-)
> > > >
> > > > diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c
> > > > b/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c
> > > > index 70d8ad065bfa..4c8fe83dd610 100644
> > > > --- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c
> > > > +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c
> > > > @@ -705,7 +705,7 @@ static int rcar_du_vsps_init(struct rcar_du_device *rcdu)
> > > > ret = of_parse_phandle_with_fixed_args(np, vsps_prop_name,
> > > > cells, i, &args);
> > > > if (ret < 0)
> > > > - goto error;
> > > > + goto done;
> > > >
> > > > /*
> > > > * Add the VSP to the list or update the corresponding existing
> > > > @@
> > > > -743,13 +743,11 @@ static int rcar_du_vsps_init(struct rcar_du_device *rcdu)
> > > > vsp->dev = rcdu;
> > > >
> > > > ret = rcar_du_vsp_init(vsp, vsps[i].np, vsps[i].crtcs_mask);
> > > > - if (ret < 0)
> > > > - goto error;
> > > > + if (ret)
> > > > + goto done;
> > > > }
> > > >
> > > > - return 0;
> > > > -
> > > > -error:
> > > > +done:
> > > > for (i = 0; i < ARRAY_SIZE(vsps); ++i)
> > > > of_node_put(vsps[i].np);
> > > >
>
> --
> Regards,
>
> Laurent Pinchart
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2] drm: rcar-du: Fix memory leak in rcar_du_vsps_init()
2024-08-28 7:21 ` Biju Das
@ 2024-08-29 13:52 ` Laurent Pinchart
0 siblings, 0 replies; 9+ messages in thread
From: Laurent Pinchart @ 2024-08-29 13:52 UTC (permalink / raw)
To: Biju Das
Cc: Tomi Valkeinen, David Airlie, Daniel Vetter, Kieran Bingham,
Jacopo Mondi, dri-devel@lists.freedesktop.org,
linux-renesas-soc@vger.kernel.org, Geert Uytterhoeven,
Prabhakar Mahadev Lad, biju.das.au
On Wed, Aug 28, 2024 at 07:21:32AM +0000, Biju Das wrote:
> On Tuesday, August 27, 2024 11:23 PM, Laurent Pinchart wrote:
> > Subject: Re: [PATCH v2] drm: rcar-du: Fix memory leak in rcar_du_vsps_init()
> >
> > Hi Biju,
> >
> > On Tue, Aug 27, 2024 at 04:43:12PM +0000, Biju Das wrote:
> > > Hi Laurent and Tomi,
> > >
> > > Gentle ping. Are you happy with this patch?
> >
> > I've sent a pull request last Friday, see
> > https://lore.kernel.org/r/20240822234445.GA23541@pendragon.ideasonboard.com
>
> I believe the commit[1] won't apply any more as the source location is moved.
> Shall I resend the patch or You will take care, please let me know.
>
> [1] https://git.kernel.org/pub/scm/linux/kernel/git/pinchartl/linux.git/commit/?h=drm-next-20240823&id=866dfbc953d46cf7682c6a434a4dd6249677fd68
I think git will be able to handle that nicely.
> > > > -----Original Message-----
> > > > From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > > > Sent: Monday, December 18, 2023 10:39 AM
> > > > Subject: Re: [PATCH v2] drm: rcar-du: Fix memory leak in
> > > > rcar_du_vsps_init()
> > > >
> > > > Hi Biju,
> > > >
> > > > Thank you for the patch.
> > > >
> > > > On Thu, Nov 16, 2023 at 12:24:24PM +0000, Biju Das wrote:
> > > > > The rcar_du_vsps_init() doesn't free the np allocated by
> > > > > of_parse_phandle_with_fixed_args() for the non-error case.
> > > > >
> > > > > Fix memory leak for the non-error case.
> > > > >
> > > > > While at it, replace the label 'error'->'done' as it applies to
> > > > > non-error case as well and update the error check condition for
> > > > > rcar_du_vsp_init() to avoid breakage in future, if it returns positive value.
> > > > >
> > > > > Fixes: 3e81374e2014 ("drm: rcar-du: Support multiple sources from
> > > > > the same VSP")
> > > > > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> > > >
> > > > Reviewed-by: Laurent Pinchart
> > > > <laurent.pinchart+renesas@ideasonboard.com>
> > > >
> > > > > ---
> > > > > v1->v2:
> > > > > * Replaced the label 'error'->'done' as it applies to non-error case as
> > > > > well.
> > > > > * Update the error check condition for rcar_du_vsp_init() to avoid
> > > > > breakage in future, if it returns positive value.
> > > > > ---
> > > > > drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c | 10 ++++------
> > > > > 1 file changed, 4 insertions(+), 6 deletions(-)
> > > > >
> > > > > diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c
> > > > > b/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c
> > > > > index 70d8ad065bfa..4c8fe83dd610 100644
> > > > > --- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c
> > > > > +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c
> > > > > @@ -705,7 +705,7 @@ static int rcar_du_vsps_init(struct rcar_du_device *rcdu)
> > > > > ret = of_parse_phandle_with_fixed_args(np, vsps_prop_name,
> > > > > cells, i, &args);
> > > > > if (ret < 0)
> > > > > - goto error;
> > > > > + goto done;
> > > > >
> > > > > /*
> > > > > * Add the VSP to the list or update the corresponding existing
> > > > > @@
> > > > > -743,13 +743,11 @@ static int rcar_du_vsps_init(struct rcar_du_device *rcdu)
> > > > > vsp->dev = rcdu;
> > > > >
> > > > > ret = rcar_du_vsp_init(vsp, vsps[i].np, vsps[i].crtcs_mask);
> > > > > - if (ret < 0)
> > > > > - goto error;
> > > > > + if (ret)
> > > > > + goto done;
> > > > > }
> > > > >
> > > > > - return 0;
> > > > > -
> > > > > -error:
> > > > > +done:
> > > > > for (i = 0; i < ARRAY_SIZE(vsps); ++i)
> > > > > of_node_put(vsps[i].np);
> > > > >
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2024-08-29 13:52 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-16 12:24 [PATCH v2] drm: rcar-du: Fix memory leak in rcar_du_vsps_init() Biju Das
2023-12-15 9:15 ` Biju Das
2023-12-18 10:39 ` Laurent Pinchart
2024-01-04 11:04 ` Biju Das
2024-08-27 16:43 ` Biju Das
2024-08-27 22:22 ` Laurent Pinchart
2024-08-28 5:54 ` Biju Das
2024-08-28 7:21 ` Biju Das
2024-08-29 13:52 ` Laurent Pinchart
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox