All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philipp Zabel <p.zabel@pengutronix.de>
To: Jyri Sarha <jsarha@ti.com>, linux-kernel@vger.kernel.org
Cc: tomi.valkeinen@ti.com, colin.king@canonical.com, treding@nvidia.com
Subject: Re: [PATCH] reset: Free struct reset_control_array in reset_control_array_put()
Date: Mon, 04 Nov 2019 17:30:44 +0100	[thread overview]
Message-ID: <3a970f3f3518485f58e86f2523e5085f47ec4b15.camel@pengutronix.de> (raw)
In-Reply-To: <9c8c5c337a9351a561a4bf18f2faa1e9a01b50e6.1572884515.git.jsarha@ti.com>

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


  reply	other threads:[~2019-11-04 16:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2019-11-04 19:03   ` Jyri Sarha
2019-11-06  9:06     ` Philipp Zabel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3a970f3f3518485f58e86f2523e5085f47ec4b15.camel@pengutronix.de \
    --to=p.zabel@pengutronix.de \
    --cc=colin.king@canonical.com \
    --cc=jsarha@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tomi.valkeinen@ti.com \
    --cc=treding@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.