All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] reset: Free struct reset_control_array in reset_control_array_put()
@ 2019-11-04 16:24 Jyri Sarha
  2019-11-04 16:30 ` Philipp Zabel
  0 siblings, 1 reply; 4+ messages in thread
From: Jyri Sarha @ 2019-11-04 16:24 UTC (permalink / raw)
  To: p.zabel, linux-kernel; +Cc: tomi.valkeinen, colin.king, treding

Fix memory leak in devm_reset_control_array_get(). Free also the
struct reset_control_array pointer in reset_control_array_put() not
only the reset-controls stored in it.

Reported-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Jyri Sarha <jsarha@ti.com>
---
 drivers/reset/core.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/reset/core.c b/drivers/reset/core.c
index 213ff40dda11..85d9676ee969 100644
--- a/drivers/reset/core.c
+++ b/drivers/reset/core.c
@@ -748,6 +748,8 @@ static void reset_control_array_put(struct reset_control_array *resets)
 	for (i = 0; i < resets->num_rstcs; i++)
 		__reset_control_put_internal(resets->rstc[i]);
 	mutex_unlock(&reset_list_mutex);
+
+	kfree(resets);
 }
 
 /**
-- 
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] reset: Free struct reset_control_array in reset_control_array_put()
  2019-11-04 16:24 [PATCH] reset: Free struct reset_control_array in reset_control_array_put() Jyri Sarha
@ 2019-11-04 16:30 ` Philipp Zabel
  2019-11-04 19:03   ` Jyri Sarha
  0 siblings, 1 reply; 4+ messages in thread
From: Philipp Zabel @ 2019-11-04 16:30 UTC (permalink / raw)
  To: Jyri Sarha, linux-kernel; +Cc: tomi.valkeinen, colin.king, treding

Hi Jyri,

On Mon, 2019-11-04 at 18:24 +0200, Jyri Sarha wrote:
> Fix memory leak in devm_reset_control_array_get(). Free also the
> struct reset_control_array pointer in reset_control_array_put() not
> only the reset-controls stored in it.
> 
> Reported-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
> Signed-off-by: Jyri Sarha <jsarha@ti.com>
> ---
>  drivers/reset/core.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/reset/core.c b/drivers/reset/core.c
> index 213ff40dda11..85d9676ee969 100644
> --- a/drivers/reset/core.c
> +++ b/drivers/reset/core.c
> @@ -748,6 +748,8 @@ static void reset_control_array_put(struct reset_control_array *resets)
>  	for (i = 0; i < resets->num_rstcs; i++)
>  		__reset_control_put_internal(resets->rstc[i]);
>  	mutex_unlock(&reset_list_mutex);
> +
> +	kfree(resets);
>  }
>  
>  /**

Thank you, this just got fixed in 532f9cd6ee99 ("reset: Fix memory leak
in reset_control_array_put()").

regards
Philipp


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] reset: Free struct reset_control_array in reset_control_array_put()
  2019-11-04 16:30 ` Philipp Zabel
@ 2019-11-04 19:03   ` Jyri Sarha
  2019-11-06  9:06     ` Philipp Zabel
  0 siblings, 1 reply; 4+ messages in thread
From: Jyri Sarha @ 2019-11-04 19:03 UTC (permalink / raw)
  To: Philipp Zabel, linux-kernel; +Cc: tomi.valkeinen, colin.king, treding

On 04/11/2019 18:30, Philipp Zabel wrote:
> Hi Jyri,
> 
> On Mon, 2019-11-04 at 18:24 +0200, Jyri Sarha wrote:
>> Fix memory leak in devm_reset_control_array_get(). Free also the
>> struct reset_control_array pointer in reset_control_array_put() not
>> only the reset-controls stored in it.
>>
>> Reported-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
>> Signed-off-by: Jyri Sarha <jsarha@ti.com>
>> ---
>>  drivers/reset/core.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/reset/core.c b/drivers/reset/core.c
>> index 213ff40dda11..85d9676ee969 100644
>> --- a/drivers/reset/core.c
>> +++ b/drivers/reset/core.c
>> @@ -748,6 +748,8 @@ static void reset_control_array_put(struct reset_control_array *resets)
>>  	for (i = 0; i < resets->num_rstcs; i++)
>>  		__reset_control_put_internal(resets->rstc[i]);
>>  	mutex_unlock(&reset_list_mutex);
>> +
>> +	kfree(resets);
>>  }
>>  
>>  /**
> 
> Thank you, this just got fixed in 532f9cd6ee99 ("reset: Fix memory leak
> in reset_control_array_put()").
> 

Ok, sorry. I just checked the mainline, not the mailing lists etc.

Best regards,
Jyri


-- 
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] reset: Free struct reset_control_array in reset_control_array_put()
  2019-11-04 19:03   ` Jyri Sarha
@ 2019-11-06  9:06     ` Philipp Zabel
  0 siblings, 0 replies; 4+ messages in thread
From: Philipp Zabel @ 2019-11-06  9:06 UTC (permalink / raw)
  To: Jyri Sarha, linux-kernel; +Cc: tomi.valkeinen, colin.king, treding

On Mon, 2019-11-04 at 21:03 +0200, Jyri Sarha wrote:
> On 04/11/2019 18:30, Philipp Zabel wrote:
> > Hi Jyri,
> > 
> > On Mon, 2019-11-04 at 18:24 +0200, Jyri Sarha wrote:
> > > Fix memory leak in devm_reset_control_array_get(). Free also the
> > > struct reset_control_array pointer in reset_control_array_put() not
> > > only the reset-controls stored in it.
> > > 
> > > Reported-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
> > > Signed-off-by: Jyri Sarha <jsarha@ti.com>
> > > ---
> > >  drivers/reset/core.c | 2 ++
> > >  1 file changed, 2 insertions(+)
> > > 
> > > diff --git a/drivers/reset/core.c b/drivers/reset/core.c
> > > index 213ff40dda11..85d9676ee969 100644
> > > --- a/drivers/reset/core.c
> > > +++ b/drivers/reset/core.c
> > > @@ -748,6 +748,8 @@ static void reset_control_array_put(struct reset_control_array *resets)
> > >  	for (i = 0; i < resets->num_rstcs; i++)
> > >  		__reset_control_put_internal(resets->rstc[i]);
> > >  	mutex_unlock(&reset_list_mutex);
> > > +
> > > +	kfree(resets);
> > >  }
> > >  
> > >  /**
> > 
> > Thank you, this just got fixed in 532f9cd6ee99 ("reset: Fix memory leak
> > in reset_control_array_put()").
> > 
> 
> Ok, sorry. I just checked the mainline, not the mailing lists etc.

No worries, that's perfectly fine. Just letting you know why this patch
isn't picked up.

regards
Philipp


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-11-06  9:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-04 16:24 [PATCH] reset: Free struct reset_control_array in reset_control_array_put() Jyri Sarha
2019-11-04 16:30 ` Philipp Zabel
2019-11-04 19:03   ` Jyri Sarha
2019-11-06  9:06     ` Philipp Zabel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.