Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1280389ybg; Thu, 4 Jun 2020 05:58:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzXPKwXz11N3toMTM/kZWGzJpxo5+toMSBBP3VPaE70VC7WaDaTnkDrv5spAFGWgsJrKysN X-Received: by 2002:a17:906:34c4:: with SMTP id h4mr4046718ejb.167.1591275525246; Thu, 04 Jun 2020 05:58:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591275525; cv=none; d=google.com; s=arc-20160816; b=liQCOQI8NtGYJBpC+/1DAp6OLSwvyroOLF1sLBFZd80dyb0r5u6CT1dl1IxMEKtxwz 36zZzFCYecNbivhH7wAlXUZSIYYyA2LojKr6snAzJU8k2jKg4jAz01hXEQoXOIPFh9h3 H64ABOWY0sHkJGqkkOC8RL6uFvNAqbnuqfvkfRzcEtfRA3peSV1NSr2H7J04nLleUeZj 8wt1qQUTwoEXy22mj4XM61t+Icp1pemWBSUlAoN9mpBHm2r+l4+umXY++2u58BRH+xjQ Hdj9u+1u7L6SKy+8Wh/wrX29kzV3nPA9RkFnPASBitjhL8ZHd+aUSGmAGmtRceELMUM8 I7Tg== 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 :message-id:date:subject:cc:to:from; bh=I+T4a/K2DGHf7cf/NXgqqInb1lYvZPk1WZQNcpjFcNs=; b=T9LufMKx0qLGUaVLbp1fiVO1Y/CVHH5tP/ddW6vCpG260j68dvaR6Lkk/ZgP++UA1Q ul51S2EztzeOsUAJdnqwpaWORv/v4tkYPEq2BQzye2ZOIxXw9SC5OFGEy5sSdMdLpgFV caoeX7blZQTPv8fdm4WaBwIM+oH7UbPTduQiHeNgYqYGlaJgB2pRfw9kLcn0rMu/195X vfRlouFUWlw+o/vBjWYlBcRCcZ/TONoGzm0NIWPDWw/lwe+l4GVQg1fDht4ep2CWhn4/ eLUDmwRzIsD/Nw91P/uoKfWw4b2nNkOzTiiqr1w9fH3KA5DBrljtAA8zLyXy2jDdiAbu VHUQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l2si1345989ejg.443.2020.06.04.05.58.21; Thu, 04 Jun 2020 05:58:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728116AbgFDM4X (ORCPT + 99 others); Thu, 4 Jun 2020 08:56:23 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:41833 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726003AbgFDM4W (ORCPT ); Thu, 4 Jun 2020 08:56:22 -0400 Received: by mail-lj1-f196.google.com with SMTP id 9so7118013ljc.8 for ; Thu, 04 Jun 2020 05:56:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=I+T4a/K2DGHf7cf/NXgqqInb1lYvZPk1WZQNcpjFcNs=; b=ZqoJQLlLkxAAMbM3/doprCXi+Dn/5yRafiHz8Pg0rbGJjTBJnSNYG+PLZMIHN1YJUZ dvuvK5BgsyG09FR98w4asDEADpalxvebixZVr47avbVBFvhtyx3TOLZbvQkrPsU0QTEw o/sLJgAJm+blLL9BKwS2UJGK7eYhLRu5NEyuoAUMobhWwrlK/LGYSP2Ov88rXdCVWP5Y WQ7jnSczPSF8R7FCz8lVotN3golnNsJX1zwZBVdkE+vxLohWy49GGKFncTX/1P0X9JdH /agR/RTRdHH/1nQ24zLeiSQZH/jWkiNX5NAn4C6Qs+2wFkOxnUxrtbOpxnCOGKxMOylS chZA== X-Gm-Message-State: AOAM5307uR6G4ep34NdBuss4MsLHmsAgCb2UJ4X+hO9vy6Khbdbku2LX yTcL40qicmWSlE09VfYpfEY= X-Received: by 2002:a2e:811:: with SMTP id 17mr2055650lji.287.1591275381730; Thu, 04 Jun 2020 05:56:21 -0700 (PDT) Received: from localhost.localdomain (broadband-37-110-38-130.ip.moscow.rt.ru. [37.110.38.130]) by smtp.googlemail.com with ESMTPSA id l8sm1176676ljc.59.2020.06.04.05.56.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jun 2020 05:56:21 -0700 (PDT) From: Denis Efremov To: Evgeniy Polyakov Cc: Denis Efremov , linux-kernel@vger.kernel.org Subject: [PATCH] w1: Use kzfree() in w1_master_release() Date: Thu, 4 Jun 2020 15:56:17 +0300 Message-Id: <20200604125617.100046-1-efremov@linux.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use kzfree() instead of memset() with 0 followed by kfree(). The pointer is allocated in w1_alloc_dev(). Signed-off-by: Denis Efremov --- drivers/w1/w1.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c index e58c7592008d..24baacf8314c 100644 --- a/drivers/w1/w1.c +++ b/drivers/w1/w1.c @@ -71,8 +71,7 @@ static void w1_master_release(struct device *dev) struct w1_master *md = dev_to_w1_master(dev); dev_dbg(dev, "%s: Releasing %s.\n", __func__, md->name); - memset(md, 0, sizeof(struct w1_master) + sizeof(struct w1_bus_master)); - kfree(md); + kzfree(md); } static void w1_slave_release(struct device *dev) -- 2.26.2