lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 4 Nov 2022 17:05:44 +0800
From:   Herbert Xu <herbert@...dor.apana.org.au>
To:     Kai Ye <yekai13@...wei.com>
Cc:     linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/3] crypto: hisilicon/qm - modify the process of regs dfx

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@...dor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ