Linux cryptographic layer development
 help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: "yekai (A)" <yekai13@huawei.com>
Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org,
	wangzhou1@hisilicon.com
Subject: Re: [PATCH v2 1/4] crypto: hisilicon/qm - modify the process of regs dfx
Date: Mon, 7 Nov 2022 16:47:22 +0800	[thread overview]
Message-ID: <Y2jGGuewePunGPtl@gondor.apana.org.au> (raw)
In-Reply-To: <45cf9fba-fae6-8279-bfac-f70110df42dc@huawei.com>

On Mon, Nov 07, 2022 at 02:53:28PM +0800, yekai (A) wrote:
> 
> 
> On 2022/11/5 18:18, Herbert Xu wrote:
> > On Sat, Nov 05, 2022 at 09:53:54AM +0000, Kai Ye wrote:
> >> +static void dfx_regs_uninit(struct hisi_qm *qm,
> >> +		struct dfx_diff_registers *dregs, int reg_len)
> >> +{
> >> +	int i;
> >> +
> >> +	/* Setting the pointer is NULL to prevent double free */
> >> +	for (i = 0; i < reg_len; i++) {
> >> +		kfree(dregs[i].regs);
> >> +		dregs[i].regs = NULL;
> >> +	}
> >> +	kfree(dregs);
> >> +	dregs = NULL;
> >> +}
> > The line that I complained about is still here.
> >
> > Cheers,
> 
> ok

Just to be clear, it's the last line "dregs = NULL" that I was
referring to.  It makes no sense to zero a variable that is on
the stack.

Cheers,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

  reply	other threads:[~2022-11-07  8:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-05  9:53 [PATCH v2 0/4] crypto: hisilicon/qm - reconstruct and optimize the debugfs code Kai Ye
2022-11-05  9:53 ` [PATCH v2 1/4] crypto: hisilicon/qm - modify the process of regs dfx Kai Ye
2022-11-05 10:18   ` Herbert Xu
2022-11-07  6:53     ` yekai (A)
2022-11-07  8:47       ` Herbert Xu [this message]
2022-11-07 10:46         ` yekai (A)
2022-11-05  9:53 ` [PATCH v2 2/4] crypto: hisilicon/qm - split a debugfs.c from qm Kai Ye
2022-11-05  9:53 ` [PATCH v2 3/4] crypto: hisilicon/qm - the command dump process is modified Kai Ye
2022-11-05  9:53 ` [PATCH v2 4/4] crypto: hisilicon/debugfs - delete redundant null assignment operations Kai Ye

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=Y2jGGuewePunGPtl@gondor.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wangzhou1@hisilicon.com \
    --cc=yekai13@huawei.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