public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Hangyu Hua <hbh25y@gmail.com>
To: alexander.shishkin@linux.intel.com, mcoquelin.stm32@gmail.com,
	alexandre.torgue@foss.st.com, gregkh@linuxfoundation.org,
	mathieu.poirier@linaro.org
Cc: linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] hwtracing: stm: fix possible double free in stm_register_device()
Date: Thu, 5 May 2022 09:29:14 +0800	[thread overview]
Message-ID: <3e01d35c-e748-3e03-4417-8b7dea09075e@gmail.com> (raw)
In-Reply-To: <20220418081632.35121-1-hbh25y@gmail.com>

Ping

On 2022/4/18 16:16, Hangyu Hua wrote:
> put_device() will call stm_device_release() to free stm when
> stm_register_device() fails. So there is no need to call vfree() again.
> 
> Fix this by adding a return after put_device().
> 
> Fixes: 7bd1d4093c2f ("stm class: Introduce an abstraction for System Trace Module devices")
> Signed-off-by: Hangyu Hua <hbh25y@gmail.com>
> ---
>   drivers/hwtracing/stm/core.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/hwtracing/stm/core.c b/drivers/hwtracing/stm/core.c
> index 2712e699ba08..403b4f41bb1b 100644
> --- a/drivers/hwtracing/stm/core.c
> +++ b/drivers/hwtracing/stm/core.c
> @@ -915,6 +915,7 @@ int stm_register_device(struct device *parent, struct stm_data *stm_data,
>   
>   	/* matches device_initialize() above */
>   	put_device(&stm->dev);
> +	return err;
>   err_free:
>   	vfree(stm);
>   

  reply	other threads:[~2022-05-05  1:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-18  8:16 [PATCH] hwtracing: stm: fix possible double free in stm_register_device() Hangyu Hua
2022-05-05  1:29 ` Hangyu Hua [this message]
2022-05-23  1:55   ` Hangyu Hua
2022-06-23  1:44     ` Hangyu Hua

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=3e01d35c-e748-3e03-4417-8b7dea09075e@gmail.com \
    --to=hbh25y@gmail.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=mathieu.poirier@linaro.org \
    --cc=mcoquelin.stm32@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox