Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp152109ybe; Tue, 3 Sep 2019 19:43:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqxbbCVFQTmYR9lIs1fYjhQyfniuisd+FMGV+NZM8JrV2R9jbpJAoZyk2kDQbmsquW3AmfZy X-Received: by 2002:a17:902:7b8c:: with SMTP id w12mr35464108pll.276.1567565004807; Tue, 03 Sep 2019 19:43:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567565004; cv=none; d=google.com; s=arc-20160816; b=e43I4s/+XHgy2eTwmq4GMcPzc7RrJ4enVmEQPmjKW8dxyBIWaeScPwaNS1hS1vNklL mGMba1JVMuAzJSe2wO4w9GlKRtW5WEebuLOHqsjfIgCs3SuquAAYN8un7TPjfN/oRylg pAGx/7Kj1H2JTIz2trwh3EesrjHxozXDs0mDrlhFrIyARba3wGrIHRM3wn3eQjjec5t5 Stbyge4AAVs3OGwH3/wZf2rHCJBGHjQcVmjVOybe2a6N3m1p7lxNgDrdtu+xB6czto+6 8Iki30Ubvg9q4S/ubTf/J/l0ieDHYUatnRBz4MSibyNmd3PIyMImNLtYvSrmRa7+wgg5 YkJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=A7m1+IpW+Xepny40cd4g1lj/r8Dmps3pWcofPq3eabY=; b=ZD1FdCiXmllsn0aSjtRlYDYOnTHIexc/oxKZgqv4CI7NWod3bR3mb9GTquyl4mtw0U JFS38OgH9zszzGXPGHhGZHBbMT7zR5UPAzMfDCfwz8+HE9npV7CcESk8cfkdSdlotLFb Lgi9zomMMnXiv3tlxyALe2BW00G2mswEUVY88cKpNtYcagIxPISF+GnPxUrvN55TbaF6 tKw9oHPeCyDPMpD6hbzdeItPtJ/0QOqHf9gb2D+qvoJtYrHI7/pFcROfRNDIOFOiE4e4 r6xbZKPC3kaHZnRKP0jjDHb+yNXQ1/HUbYYkCpoq6TSuNBYokedQqt0chwtW/gIPhblF 43Jw== ARC-Authentication-Results: i=1; mx.google.com; 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 h129si19516620pfb.91.2019.09.03.19.43.08; Tue, 03 Sep 2019 19:43:24 -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; 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 S1728180AbfIDCmU (ORCPT + 99 others); Tue, 3 Sep 2019 22:42:20 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:5747 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726589AbfIDCmR (ORCPT ); Tue, 3 Sep 2019 22:42:17 -0400 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 0304EC5DB61CD4441C81; Wed, 4 Sep 2019 10:42:15 +0800 (CST) Received: from linux-ibm.site (10.175.102.37) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.439.0; Wed, 4 Sep 2019 10:42:07 +0800 From: zhong jiang To: , , CC: , , Subject: [PATCH 1/3] ixgbe: Use kzfree() rather than its implementation. Date: Wed, 4 Sep 2019 10:39:10 +0800 Message-ID: <1567564752-6430-2-git-send-email-zhongjiang@huawei.com> X-Mailer: git-send-email 1.7.12.4 In-Reply-To: <1567564752-6430-1-git-send-email-zhongjiang@huawei.com> References: <1567564752-6430-1-git-send-email-zhongjiang@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.102.37] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; } -- 1.7.12.4