All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joerg Roedel <joro@8bytes.org>
To: zhong jiang <zhongjiang@huawei.com>
Cc: davem@davemloft.net, herbert@gondor.apana.org.au,
	arno@natisbad.org, gregkh@linuxfoundation.org,
	iommu@lists.linux-foundation.org, linux-crypto@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] iommu/pamu: Use kzfree rather than its implementation
Date: Wed, 4 Sep 2019 10:15:17 +0200	[thread overview]
Message-ID: <20190904081517.GA29855@8bytes.org> (raw)
In-Reply-To: <1567566079-7412-3-git-send-email-zhongjiang@huawei.com>

On Wed, Sep 04, 2019 at 11:01:18AM +0800, zhong jiang wrote:
> Use kzfree instead of memset() + kfree().
> 
> Signed-off-by: zhong jiang <zhongjiang@huawei.com>
> ---
>  drivers/iommu/fsl_pamu.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/iommu/fsl_pamu.c b/drivers/iommu/fsl_pamu.c
> index cde281b..ca6d147 100644
> --- a/drivers/iommu/fsl_pamu.c
> +++ b/drivers/iommu/fsl_pamu.c
> @@ -1174,10 +1174,8 @@ static int fsl_pamu_probe(struct platform_device *pdev)
>  	if (irq != NO_IRQ)
>  		free_irq(irq, data);
>  
> -	if (data) {
> -		memset(data, 0, sizeof(struct pamu_isr_data));
> -		kfree(data);
> -	}
> +	if (data)
> +		kzfree(data);

kzfree() is doing its own NULL-ptr check, no need to do it here.

Regards,

	Joerg

WARNING: multiple messages have this Message-ID (diff)
From: Joerg Roedel <joro@8bytes.org>
To: zhong jiang <zhongjiang@huawei.com>
Cc: herbert@gondor.apana.org.au, gregkh@linuxfoundation.org,
	arno@natisbad.org, linux-kernel@vger.kernel.org,
	iommu@lists.linux-foundation.org, linux-crypto@vger.kernel.org,
	davem@davemloft.net
Subject: Re: [PATCH 2/3] iommu/pamu: Use kzfree rather than its implementation
Date: Wed, 4 Sep 2019 10:15:17 +0200	[thread overview]
Message-ID: <20190904081517.GA29855@8bytes.org> (raw)
In-Reply-To: <1567566079-7412-3-git-send-email-zhongjiang@huawei.com>

On Wed, Sep 04, 2019 at 11:01:18AM +0800, zhong jiang wrote:
> Use kzfree instead of memset() + kfree().
> 
> Signed-off-by: zhong jiang <zhongjiang@huawei.com>
> ---
>  drivers/iommu/fsl_pamu.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/iommu/fsl_pamu.c b/drivers/iommu/fsl_pamu.c
> index cde281b..ca6d147 100644
> --- a/drivers/iommu/fsl_pamu.c
> +++ b/drivers/iommu/fsl_pamu.c
> @@ -1174,10 +1174,8 @@ static int fsl_pamu_probe(struct platform_device *pdev)
>  	if (irq != NO_IRQ)
>  		free_irq(irq, data);
>  
> -	if (data) {
> -		memset(data, 0, sizeof(struct pamu_isr_data));
> -		kfree(data);
> -	}
> +	if (data)
> +		kzfree(data);

kzfree() is doing its own NULL-ptr check, no need to do it here.

Regards,

	Joerg
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

  reply	other threads:[~2019-09-04  8:15 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-04  3:01 [PATCH 0/3] Use kzfree instead of memset() + kfree() zhong jiang
2019-09-04  3:01 ` zhong jiang
2019-09-04  3:01 ` [PATCH 1/3] crypto: marvell: Use kzfree rather than its implementation zhong jiang
2019-09-04  3:01   ` zhong jiang
2019-09-09  7:53   ` Herbert Xu
2019-09-09  7:53     ` Herbert Xu
2019-09-04  3:01 ` [PATCH 2/3] iommu/pamu: " zhong jiang
2019-09-04  3:01   ` zhong jiang
2019-09-04  8:15   ` Joerg Roedel [this message]
2019-09-04  8:15     ` Joerg Roedel
2019-09-04  9:38     ` zhong jiang
2019-09-04  9:38       ` zhong jiang
2019-09-04  3:01 ` [PATCH 3/3] Staging: rtl8723bs: " zhong jiang
2019-09-04  3:01   ` zhong jiang

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=20190904081517.GA29855@8bytes.org \
    --to=joro@8bytes.org \
    --cc=arno@natisbad.org \
    --cc=davem@davemloft.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=iommu@lists.linux-foundation.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zhongjiang@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.