Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp152224ybe; Tue, 3 Sep 2019 19:43:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqzKdK0X8Cc39eBDg2PAvmGnmMF8Do+q7AhdsBBW97SzzoIiTxSPaquL2TQ+W8I96EfZ+qb0 X-Received: by 2002:a17:90a:8d0c:: with SMTP id c12mr2568252pjo.133.1567565013448; Tue, 03 Sep 2019 19:43:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567565013; cv=none; d=google.com; s=arc-20160816; b=SumPQx9OAK/pUs6uOM4uIBeewtr2z9i0rafwzXrWTxa6OV1XXlS0lbIKSiIBD365DY oalny3Gim85+sfnC8c/A28P3Mj26JOUNFl69vK/sCmQENhLnpU8akyOlU2sh/PCDsMPk hTIztgap3racEQavPVfiMurPlZncf7mkn/e71AJM84inp0JrI/PrLJc3kPC7qxLCm9+t GnxEaaXPcE0IXv94UYRUHByxyxDwd3PNqItz0U+UeOJAxFiahE/0dHl01nUcU+WxtsoJ 8aYkLuOd9snuIsOYumGJN+0b2rMX3GX7br4AsvBqK7X0AGbMlt/jvVGj/aB/tw+vg9nR 1mLw== 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=OZZrzyDbURctsJEKcvRJvYByAN6yWLJ8o91hzEz30EU=; b=inyDjM4oQx3KW7AobO2jj2Vq8RbYnv6UYZxFfZ0y7HrKIOkt7R8X4jC//LPTN6KSQl bhWziTUFdLB/NmzWnskGhqo6xJFm48RzNEccMm+HiM5AK4qITws1Rx3j2UPRKuAdOiD4 mthrT/zt5Glj768ksR1qc4//RFl8coByarLM5+zRopprEktU5lqH979NjvEj/2B7KDD6 ZnJBjeTbtXOXSZVrLyOlXFU6W+36OvfscnUZvPzw03KKpGILGxKAwLjxmPOk1Kah2wNK mk/1qQecZoXa2ePku9Ad4AvQjEBGIH+zPuo+9XMf8sCyUHVPb2wc5Dmz8QbjdqZ1EKiz ADdA== 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 y9si18795707pfm.25.2019.09.03.19.43.18; Tue, 03 Sep 2019 19:43:33 -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 S1727961AbfIDCmR (ORCPT + 99 others); Tue, 3 Sep 2019 22:42:17 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:5746 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727381AbfIDCmQ (ORCPT ); Tue, 3 Sep 2019 22:42:16 -0400 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id F2AD8AE122B36680B73C; Wed, 4 Sep 2019 10:42:14 +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:08 +0800 From: zhong jiang To: , , CC: , , Subject: [PATCH 3/3] net: mpoa: Use kzfree rather than its implementation. Date: Wed, 4 Sep 2019 10:39:12 +0800 Message-ID: <1567564752-6430-4-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/atm/mpoa_caches.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/net/atm/mpoa_caches.c b/net/atm/mpoa_caches.c index 4bb4183..3286f9d 100644 --- a/net/atm/mpoa_caches.c +++ b/net/atm/mpoa_caches.c @@ -180,8 +180,7 @@ static int cache_hit(in_cache_entry *entry, struct mpoa_client *mpc) static void in_cache_put(in_cache_entry *entry) { if (refcount_dec_and_test(&entry->use)) { - memset(entry, 0, sizeof(in_cache_entry)); - kfree(entry); + kzfree(entry); } } @@ -416,8 +415,7 @@ static eg_cache_entry *eg_cache_get_by_src_ip(__be32 ipaddr, static void eg_cache_put(eg_cache_entry *entry) { if (refcount_dec_and_test(&entry->use)) { - memset(entry, 0, sizeof(eg_cache_entry)); - kfree(entry); + kzfree(entry); } } -- 1.7.12.4