Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp152527ybe; Tue, 3 Sep 2019 19:44:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqzt2Pky/hIzptuS38TuyeKNcY4HYfZ+faA72CTrCuqtBEH0YKaxobwtTKOQTYCeg6RvR0/y X-Received: by 2002:a17:90a:3187:: with SMTP id j7mr2515273pjb.69.1567565046121; Tue, 03 Sep 2019 19:44:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567565046; cv=none; d=google.com; s=arc-20160816; b=prdmZXujiww8XLxHLViEgJmD+um6BGRmjEko2Wsu/6esICX8hmNvx8vjYtBZHUACXp xvlCfndTyDVU4MXk+g+pIKm2th7nQrnWSr0o2Kf1pc1ZeEG0j4KJ4w6it4bPla2CDA1Q ESyxteJ+kQm6K5I0QTDxmqsK1J7qdG/D1w6eqpLtmJ9DdI4aKakUI+fQJYuCM7/Ql/Hl o6WyI7HnD/DO+TzhsG9j4iCGFBphJo8PHxd/BER7gyE9ziwsM2fV+3yHukAkXkekdy4o ToVOqIsEeHQiCBUsIkxMSf/+bErrgDLmfB0j1qzBlmLqaiTNMfhWUT956/4g5V0xsypr Zi5w== 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=9Fz9zgm3x8pCd1r7emJsFXE+XO7gKPxf8/udYtwHgzI=; b=mcV2OW9MYyVX+fVIuzClX3KUPRCBPS89E/ewf1bIJe2x6JaiBrq2CuON22lqdjPPak tSIrEyb/InEtKHwBWv2bS7XXT8+GS+3WL0Zf5pYV/3IHZXVrv5PeG4o1XYa7lyUm3u9T TBkdcrx7jmX6WTwyc7bzddv9R+RSM0g4RbhrKc2aY2Mm4D2z8jsA5JFbotWGYuVy+zuw a5POtb7sqo7iVvTkLwF2P2zzPyDctMZU1ssA/SVtp9JskjyIq2lV1tTc7g2ZjVNBwdRp /lD5H567TL9gnuHTlu2IMOaLAkskTC2XqPJa0F1isPJuDjQ7NQgN/NbbPLBgQDMNRSpl dTLA== 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 x26si16435417pgl.351.2019.09.03.19.43.50; Tue, 03 Sep 2019 19:44:06 -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 S1728246AbfIDCm1 (ORCPT + 99 others); Tue, 3 Sep 2019 22:42:27 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:38674 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727716AbfIDCmR (ORCPT ); Tue, 3 Sep 2019 22:42:17 -0400 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 20EA18269B648DA437B5; 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 2/3] sunrpc: Use kzfree rather than its implementation. Date: Wed, 4 Sep 2019 10:39:11 +0800 Message-ID: <1567564752-6430-3-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 --- net/sunrpc/auth_gss/gss_krb5_keys.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/net/sunrpc/auth_gss/gss_krb5_keys.c b/net/sunrpc/auth_gss/gss_krb5_keys.c index 550fdf1..3b7f721 100644 --- a/net/sunrpc/auth_gss/gss_krb5_keys.c +++ b/net/sunrpc/auth_gss/gss_krb5_keys.c @@ -228,14 +228,11 @@ u32 krb5_derive_key(const struct gss_krb5_enctype *gk5e, ret = 0; err_free_raw: - memset(rawkey, 0, keybytes); - kfree(rawkey); + kzfree(rawkey); err_free_out: - memset(outblockdata, 0, blocksize); - kfree(outblockdata); + kzfree(outblockdata); err_free_in: - memset(inblockdata, 0, blocksize); - kfree(inblockdata); + kzfree(inblockdata); err_free_cipher: crypto_free_sync_skcipher(cipher); err_return: -- 1.7.12.4