DPDK patches and discussions
 help / color / mirror / Atom feed
From: fengchengwen <fengchengwen@huawei.com>
To: Stephen Hemminger <stephen@networkplumber.org>, <dev@dpdk.org>
Subject: Re: [RFC 3/5] bus/uacce: remove memset before free
Date: Thu, 14 Nov 2024 08:55:35 +0800	[thread overview]
Message-ID: <69aafae6-021b-481d-9b35-b07469f00ad9@huawei.com> (raw)
In-Reply-To: <20241113185720.28706-4-stephen@networkplumber.org>

On 2024/11/14 2:56, Stephen Hemminger wrote:
> Doing memset before free maybe removed by compiler, and
> is flagged by security scanning tools as potential problem.
> In this case the memset is unnecessary.
> 
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
>  drivers/bus/uacce/uacce.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/bus/uacce/uacce.c b/drivers/bus/uacce/uacce.c
> index c1529c38c0..35c1027245 100644
> --- a/drivers/bus/uacce/uacce.c
> +++ b/drivers/bus/uacce/uacce.c
> @@ -454,7 +454,6 @@ uacce_cleanup(void)
>  		dev->device.driver = NULL;
>  
>  free:
> -		memset(dev, 0, sizeof(*dev));

It should replaced by TAILQ_REMOVE(&uacce_bus.device_list, dev, next);

And I also find other bus have the same problem, later I will push one patchset.

>  		free(dev);
>  	}
>  


  reply	other threads:[~2024-11-14  0:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-13 18:55 [RFC 0/5] Fix memset usage Stephen Hemminger
2024-11-13 18:56 ` [RFC 1/5] crypto/qat: fix memset of SHA3 state Stephen Hemminger
2024-11-13 18:56 ` [RFC 2/5] crypto/qat: use secure memset Stephen Hemminger
2024-11-13 18:56 ` [RFC 3/5] bus/uacce: remove memset before free Stephen Hemminger
2024-11-14  0:55   ` fengchengwen [this message]
2024-11-13 18:56 ` [RFC 4/5] compress/octeontx: remove memset before rte_free Stephen Hemminger
2024-11-13 18:56 ` [RFC 5/5] test: remove unneeded memset Stephen Hemminger
2024-11-14  8:56 ` [RFC 0/5] Fix memset usage Bruce Richardson

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=69aafae6-021b-481d-9b35-b07469f00ad9@huawei.com \
    --to=fengchengwen@huawei.com \
    --cc=dev@dpdk.org \
    --cc=stephen@networkplumber.org \
    /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;
as well as URLs for NNTP newsgroup(s).