Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3346009imw; Mon, 18 Jul 2022 06:34:48 -0700 (PDT) X-Google-Smtp-Source: AGRyM1stMleXpkhepzce21qMuD/wtYyzNi966eZExnYxm6/cMsJYh1H+56xsgxi0UTjZvBo0Srka X-Received: by 2002:a05:6402:5408:b0:435:60fa:5017 with SMTP id ev8-20020a056402540800b0043560fa5017mr36965420edb.223.1658151288211; Mon, 18 Jul 2022 06:34:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658151288; cv=none; d=google.com; s=arc-20160816; b=pimk8spqYn/2PsdBLbfJjpQB04/PAkKBHXjEToQfx1l9gJqe7nc47XQpASAGXIJiGi dSCywLYMvdy4Nf+mVA8qT+1l39+gQvby8QuLUHLNGFxjLLd1OGwtda0xE2FwyViJs3aT XOr3Klir7Gj4lLFxk/Q+zZMJzi8wU5E200E4J9OauER/AHd/Cag12Y9nFytMf3isRc4e E+4KC++dqPwmA3dxJsRAUhU84GlPv4Cei0vUrCm2mPH3sZs87OTf2OArT/Xu7ltS2Lac 6ljoFfHkIpXktPZ7Fk1m/353pKclmheVjQC8Re1zS7afpIeZ8WFINdgFGQYciKsoHct3 E/CQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=f1Zwx3IFterv86PUTXj2X0gMseIANZ4xM811K1mrz7E=; b=lGGKEWOD1OgngTyEser3Sj7ER2h2c1kAmp8JVCNf+6kxf6q8ioY1jRPfFLdgKanltr dTRKA1bSwFnD11ATMlV1dHZ8CyRQLV7fUTGQ07BmUFV/vM7JDbN6t/ae4QpEG80revji Y7+i0nwUdgjLwyyiU59TtlXcJ8iXyxQ56k7A/CY8YHb/E4dBxSb6AyF2Pnc/jkN7XwRZ WH+zL0wQeKGl4R9jaa1mwFzAAYoDGMacJULm1mc/jle44S+BvuvvUNR3kbemSKQy7Hi+ mNTp+Z8AejjYSBpOMMyaxG/LVgjX2YMTbcvB4OViGfz5PBWwa2Wjx4ZJh0gXnbmRgnO4 4y3Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s4-20020a17090699c400b0072f3533c922si2329700ejn.261.2022.07.18.06.34.20; Mon, 18 Jul 2022 06:34:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235317AbiGRNG0 (ORCPT + 99 others); Mon, 18 Jul 2022 09:06:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58180 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235285AbiGRNGX (ORCPT ); Mon, 18 Jul 2022 09:06:23 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C43FB27B29 for ; Mon, 18 Jul 2022 06:06:14 -0700 (PDT) Received: from kwepemi500012.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Lmhx53Cc0zkWwB; Mon, 18 Jul 2022 21:03:53 +0800 (CST) Received: from dggphis33418.huawei.com (10.244.148.83) by kwepemi500012.china.huawei.com (7.221.188.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Mon, 18 Jul 2022 21:06:12 +0800 From: Gaosheng Cui To: , , , CC: , , Subject: [PATCH -next] nvmem: node: using put_device to replace kfree_const Date: Mon, 18 Jul 2022 21:06:12 +0800 Message-ID: <20220718130612.3122982-1-cuigaosheng1@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.244.148.83] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemi500012.china.huawei.com (7.221.188.12) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We should never be touching the name pointer of a kobject directly like this, the device structure itself should be cleaning up the memory, not a kfree_const, so using put_device to replace kfree_const. Signed-off-by: Gaosheng Cui --- drivers/base/node.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/base/node.c b/drivers/base/node.c index 0ac6376ef7a1..dd2c6089bed1 100644 --- a/drivers/base/node.c +++ b/drivers/base/node.c @@ -154,7 +154,7 @@ static struct node_access_nodes *node_init_node_access(struct node *node, list_add_tail(&access_node->list_node, &node->access_list); return access_node; free_name: - kfree_const(dev->kobj.name); + put_device(&access_node->dev); free: kfree(access_node); return NULL; -- 2.25.1