Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp5092693ybe; Tue, 17 Sep 2019 02:27:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqybrRLlkxt2z+7denvfywmNEfqlCuC8rOXAz3Ov9OrRVY9J3O88RJOrPzr7zlKEqonA1D65 X-Received: by 2002:a17:906:1c4e:: with SMTP id l14mr3829939ejg.276.1568712451513; Tue, 17 Sep 2019 02:27:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568712451; cv=none; d=google.com; s=arc-20160816; b=c4m1DagSgoB0H0I4ZQcPAM4w/vT6TQHESvAJnaNVv8e8n9kPkjshVDppmoZF1HIrVQ sXsMx5dgyVQj/hFt+ddh1f3vZiep84v6j5wKZ9e4EKi9gS5lh/Q/YXbmGJSZWTYTLMFg QXa+IZgD1szEBsk0/31OV5OABPPDelnlmUhxbdOTmZ2QooOvsFBy041l6HC5PGYkgrNA Ux2c0YRKeWRX4GKv6E8pIfypPOCMI5aEvA/lMzrdksUy6f/SA3IFpmVyPlIAn3OKBzI4 qaFMGvIEBlFdbKl+Gy9MUkCKEUFF/t3UNOF81Pkjk+81AXO9qiwY/7c79HakeAj/wkp3 9Axw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=aQrXVTNYPD93A+dr3PQzbCJpCjMJXTuJQlMV8r8hKjE=; b=QGdakNV+H6DCzsR+63X9NKdVTLDcOyyfrM8w+4V5RKM6iR6dhF8FEqQ1k33Rm9cARD VWBZcnz0QdKPDUh/+t5/E/jg7a48fE8dZmMVEy4k0y3xARs4Xa0Ztq7e2adlBNzCfnLJ JR3ODCRykbXQdFZsiN58fwBLwSN6SZ8UWfDCU1M4h7tHgImGKGh9S+PyBsuCU677Mr2/ PiJVZodqBmvEDDYQwzwH/AOUNM/J2y/Ey66LFXnXIlGl6QkjuqFmGMm5vetPokumvxfY rt3accVAHef6qEsoRs/wDpf5B1NxY+mzIWKdw7d3hvweb757VPqiPLoRwf5oJvSYYer2 yytg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@netronome-com.20150623.gappssmtp.com header.s=20150623 header.b=jMhRGNsP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k1si983450ede.255.2019.09.17.02.27.08; Tue, 17 Sep 2019 02:27:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@netronome-com.20150623.gappssmtp.com header.s=20150623 header.b=jMhRGNsP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391998AbfIQCnZ (ORCPT + 99 others); Mon, 16 Sep 2019 22:43:25 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:34242 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391292AbfIQCnY (ORCPT ); Mon, 16 Sep 2019 22:43:24 -0400 Received: by mail-pf1-f193.google.com with SMTP id b128so1230452pfa.1 for ; Mon, 16 Sep 2019 19:43:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netronome-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :organization:mime-version:content-transfer-encoding; bh=aQrXVTNYPD93A+dr3PQzbCJpCjMJXTuJQlMV8r8hKjE=; b=jMhRGNsPq4gN9mlEaZ/AEVKbtiBbP49Nk000CTIHRAT7Qw5Sm5KXl30UtOnKNEXgJG BBcf0/EzePXZhMAXA1Ed+Hu3czD1Ka2KVhgyxemKS+eS5LZobAJ4B50wLjVdUSE8YD2L puiSTTu61AVk3VP0aa7iYu1y1ask/Hk4D577HbXvPrxwqtz/ggUfUxHMnx56eZlbifHi n3SLjkQco+K4dPH01qWh3ysbYuyTdJeI/9PwYRJwxPeSs+LnLSGR+qfHqzVXm86KQ7Mc 3SbrrAQoBk+vCulD8t3H4OO+kGMpKJOJRPWi9tpwOTB56Lp1/SaPjcaAtLoBuSDZ8/X2 4AWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:organization:mime-version:content-transfer-encoding; bh=aQrXVTNYPD93A+dr3PQzbCJpCjMJXTuJQlMV8r8hKjE=; b=O3I9EeTZE1kflXhs8SjGleUr539j4vG49DwjkPWC2bYnru8VMA1FQO2uuUS3qeREtk 8xbxxTwhn5FqoexMIP+kc+exRyuI7UvxgMtcw5BKUhSiw27IG+qE+Z73VPmqckg4dBTM Y0njqxEPWRqTfG0ZmkOOodweNMZ2KpZkqno5hf0hQ5CLYHyoofuXsd7n/M3mfLwq/Xqu ynEYnd805NqgYTYB/EICtckDf8Sa4JqmbE0rr+FgJKgQyLKiK/+nHVDbe1HA+GQPgeMg 7QFONE+csQ/Gsku6I080of/bq3M3GMKYDEsuOVXa7s15vW2tYuW8iw3QAVRR6SEX5jkv +V6w== X-Gm-Message-State: APjAAAXqNu7El+bpwLC8vmTtDIoMMzDtR8+2/fjDxWuLOze63MNse9MK G+CzcYHM19U4qv05y3/iMH1j7ZESIpg= X-Received: by 2002:a17:90a:e290:: with SMTP id d16mr2606067pjz.86.1568688203384; Mon, 16 Sep 2019 19:43:23 -0700 (PDT) Received: from cakuba.netronome.com ([2601:646:8e00:e18::2]) by smtp.gmail.com with ESMTPSA id x72sm450247pfc.89.2019.09.16.19.43.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Sep 2019 19:43:23 -0700 (PDT) Date: Mon, 16 Sep 2019 19:43:19 -0700 From: Jakub Kicinski To: zhong jiang Cc: , , , , Subject: Re: [PATCH 1/3] ixgbe: Use kzfree() rather than its implementation. Message-ID: <20190916194319.712d81cc@cakuba.netronome.com> In-Reply-To: <1567564752-6430-2-git-send-email-zhongjiang@huawei.com> References: <1567564752-6430-1-git-send-email-zhongjiang@huawei.com> <1567564752-6430-2-git-send-email-zhongjiang@huawei.com> Organization: Netronome Systems, Ltd. MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 4 Sep 2019 10:39:10 +0800, zhong jiang wrote: > Use kzfree() instead of memset() + kfree(). > > Signed-off-by: zhong jiang > --- > 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().