linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: Kai Ye <yekai13@huawei.com>
Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] crypto: hisilicon/qm - modify the process of regs dfx
Date: Fri, 4 Nov 2022 17:05:44 +0800	[thread overview]
Message-ID: <Y2TV6Cz7XPYj4SZO@gondor.apana.org.au> (raw)
In-Reply-To: <20221029094801.43843-2-yekai13@huawei.com>

On Sat, Oct 29, 2022 at 09:47:59AM +0000, Kai Ye wrote:
>
> diff --git a/drivers/crypto/hisilicon/qm.c b/drivers/crypto/hisilicon/qm.c
> index 363a02810a16..832cfd9a7728 100644
> --- a/drivers/crypto/hisilicon/qm.c
> +++ b/drivers/crypto/hisilicon/qm.c
> @@ -1722,8 +1722,22 @@ static int qm_regs_show(struct seq_file *s, void *unused)
>  
>  DEFINE_SHOW_ATTRIBUTE(qm_regs);
>  
> +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;

What's the point of this last NULL assignment?

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-04  9:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-29  9:47 [PATCH 0/3] crypto: hisilicon/qm - reconstruct and optimize the debugfs code Kai Ye
2022-10-29  9:47 ` [PATCH 1/3] crypto: hisilicon/qm - modify the process of regs dfx Kai Ye
2022-11-04  9:05   ` Herbert Xu [this message]
2022-11-04 10:07     ` yekai (A)
2022-11-05  1:39       ` yekai (A)
2022-11-05  2:45         ` Herbert Xu
2022-10-29  9:48 ` [PATCH 2/3] crypto: hisilicon/qm - split a debugfs.c from qm Kai Ye
2022-10-29  9:48 ` [PATCH 3/3] crypto: hisilicon/qm - the command dump process is modified 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=Y2TV6Cz7XPYj4SZO@gondor.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).