From: zhong jiang <zhongjiang@huawei.com>
To: Jakub Kicinski <jakub.kicinski@netronome.com>
Cc: <davem@davemloft.net>, <anna.schumaker@netapp.com>,
<trond.myklebust@hammerspace.com>, <netdev@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/3] ixgbe: Use kzfree() rather than its implementation.
Date: Tue, 17 Sep 2019 11:19:56 +0800 [thread overview]
Message-ID: <5D8050DC.4010909@huawei.com> (raw)
In-Reply-To: <20190916194319.712d81cc@cakuba.netronome.com>
On 2019/9/17 10:43, Jakub Kicinski wrote:
> On Wed, 4 Sep 2019 10:39:10 +0800, zhong jiang wrote:
>> Use kzfree() instead of memset() + kfree().
>>
>> Signed-off-by: zhong jiang <zhongjiang@huawei.com>
>> ---
>> drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c | 9 +++------
>> 1 file changed, 3 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c
>> index 31629fc..113f608 100644
>> --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c
>> +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c
>> @@ -960,11 +960,9 @@ int ixgbe_ipsec_vf_add_sa(struct ixgbe_adapter *adapter, u32 *msgbuf, u32 vf)
>> return 0;
>>
>> err_aead:
>> - memset(xs->aead, 0, sizeof(*xs->aead));
>> - kfree(xs->aead);
>> + kzfree(xs->aead);
>> err_xs:
>> - memset(xs, 0, sizeof(*xs));
>> - kfree(xs);
>> + kzfree(xs);
>> err_out:
>> msgbuf[1] = err;
>> return err;
>> @@ -1049,8 +1047,7 @@ int ixgbe_ipsec_vf_del_sa(struct ixgbe_adapter *adapter, u32 *msgbuf, u32 vf)
>> ixgbe_ipsec_del_sa(xs);
>>
>> /* remove the xs that was made-up in the add request */
>> - memset(xs, 0, sizeof(*xs));
>> - kfree(xs);
>> + kzfree(xs);
>>
>> return 0;
>> }
> All the crypto cases should really be converted to memzero_explicit().
It's better to do that. I will repost it in v2.
Thanks,
zhong jiang
next prev parent reply other threads:[~2019-09-17 3:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-04 2:39 [PATCH 0/3] net: Use kzfree() directly zhong jiang
2019-09-04 2:39 ` [PATCH 1/3] ixgbe: Use kzfree() rather than its implementation zhong jiang
2019-09-17 2:43 ` Jakub Kicinski
2019-09-17 3:19 ` zhong jiang [this message]
2019-09-04 2:39 ` [PATCH 2/3] sunrpc: Use kzfree " zhong jiang
2019-09-04 2:39 ` [PATCH 3/3] net: mpoa: " zhong jiang
2019-09-05 10:06 ` [PATCH 0/3] net: Use kzfree() directly David Miller
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=5D8050DC.4010909@huawei.com \
--to=zhongjiang@huawei.com \
--cc=anna.schumaker@netapp.com \
--cc=davem@davemloft.net \
--cc=jakub.kicinski@netronome.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=trond.myklebust@hammerspace.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).