Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp876428pxb; Thu, 25 Feb 2021 18:23:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJwk4+465w5DeAp6aYkgwOmpaM0a76uENjM2n9GwPA2NMw9NdqSVOlRiaGmG/Q5iOrdJd7f6 X-Received: by 2002:a17:906:9b86:: with SMTP id dd6mr771683ejc.516.1614306198308; Thu, 25 Feb 2021 18:23:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1614306198; cv=pass; d=google.com; s=arc-20160816; b=OtJeMe3+Pz97bgCS3OfpsU2Pyqcup7YltPTLE90og7zg8wWO3DraPmVTW2C6CTjz29 Wcnsv9+PAi0vTdwimqABCowtObCtc6St64duCpdMx0psDI5h1fcr/kLvw33w8/1ffRJx RQy3VvOXv2DgvekOMETm7N0Yk75YayTSkhrCTqw60NYcP5NOHLFYpwpoIOCmr68xJPKP QjjXZucOfbmZu5o+XUncvYKAVeNe/SbMO0awqX0OisIKpbrYcVc/r+6WUCAB1QDbBvib zjGF3XVBHSPGJT3fFbslVnColifOXPI5DPKGkAC1UdwkMFuEU+aJz3FCWXuhvBTr0Udf +rlg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:to:from:dkim-signature; bh=HEDsMZURRw6iWH7C+wPgPUqXu5TH/H6Kr/7iz2Mdp9U=; b=vvAlBWQ/mB9KT55YIM3doF59LCc2uuV/xqLsVY6m0qguyNttYU+xykSZLxMDJH+nSB NmdbL/zWm4GDzHzFzOj8IbPZ1OhxcwgzhnIj2bcK8rMvUKjX8JITeXcnlOjqjhtr17FW CQ+YB5wLjHSPws8YN976vrg7HcPqfq92idMzBxoJey0eteFBaosFkZH0qNDLGViGSyl8 fxJ4imIXnI+gLzJXN8CR2KMADFuB944dFzliB7sb8wLl6gRm6MoT5WceuM97mhBw2fbg XxRS1QQktFHPh0eyiRcWMbSjC4/obS7UW303ySJ48zmWvUvDppG4jiX6Gv5WtEa5TRYR OrEA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@windriversystems.onmicrosoft.com header.s=selector2-windriversystems-onmicrosoft-com header.b=H8d8t6lB; arc=pass (i=1 spf=pass spfdomain=windriver.com dkim=pass dkdomain=windriver.com dmarc=pass fromdomain=windriver.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 a16si5023032ejr.614.2021.02.25.18.22.55; Thu, 25 Feb 2021 18:23:18 -0800 (PST) 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; dkim=pass header.i=@windriversystems.onmicrosoft.com header.s=selector2-windriversystems-onmicrosoft-com header.b=H8d8t6lB; arc=pass (i=1 spf=pass spfdomain=windriver.com dkim=pass dkdomain=windriver.com dmarc=pass fromdomain=windriver.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 S229534AbhBZCUH (ORCPT + 99 others); Thu, 25 Feb 2021 21:20:07 -0500 Received: from mail-bn8nam11on2060.outbound.protection.outlook.com ([40.107.236.60]:17760 "EHLO NAM11-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229498AbhBZCUG (ORCPT ); Thu, 25 Feb 2021 21:20:06 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hZeZQfHAmpClhivF8ErJ82fk+H0eUe8wCxoKLNpM1EV+IjoCSiFuHhUH/gx7t0i5AnWmJtwPSrfXmd/6KaQZHx7f8TkLlLqW3gzmjnFfxYq3q9+DckzQYCEj0GzzoiJnabhB64msn+Xvhr2srbBLa0k+ASq5yoe+jtjTDoIHMqTGPN7HqogF389kcgSPJ0ywigheR9kLuEV8amCmGYXdKNcII9hPxOCuYEfbbNOR2bH66deX7FwWPAJzySR+3IXQGNsfGjYKIXRObboJNTYgn8yFvxaldv7blkqAsFP4tzgMAKa166aMKqPz7dOYWsVklsHYTCWhIXTNkrRn/R2PLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HEDsMZURRw6iWH7C+wPgPUqXu5TH/H6Kr/7iz2Mdp9U=; b=QtknCxkKmMkR3Gvea6YN7JzKBatX2DRaTh6ZoCDKXgEFP3locz4e9rR7cxRZIqoT5TewQngXqO8UQUdy7EQYse6yl7zCth0OY8Vt9RD7TLc8EdPyQoqfB4NJYuV85XjykNB/K5jQBCVJvjhDQMq0NEYTZMfdnwt8h9+nEkEtgiqzeBA5hYmI/lXsIFNWPKaI0CRtrz1D+3ouOkd6BO4BUBK1iJKL3kgSwAxghtRBeUEPagm+ZNiyjKnmon/vleaOzQHp0UIHORrocgZeuWtUsn5m5gzTlh3StJ8+ZU8vqxj6j25YHiSHIn10CmOTNc3eLwLL6QH5sCfQOTVwiBAj9g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=windriver.com; dmarc=pass action=none header.from=windriver.com; dkim=pass header.d=windriver.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=windriversystems.onmicrosoft.com; s=selector2-windriversystems-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HEDsMZURRw6iWH7C+wPgPUqXu5TH/H6Kr/7iz2Mdp9U=; b=H8d8t6lBv0lx1xB9RUyKc0+tuHu+qPA+oRrPl6/2LuBXfSGihbBMYy5ZgBnwrlAHftJe/6M75lhDGAH9HQhbWDqWSz3/1czjLerNgDZ6LObqXTI5mHUtWd3OxUqxY3SzYgiWwt8mQxBJ7RnB+noB1hmZBZBZSZEVTOc76B15lMI= Received: from CO1PR11MB4849.namprd11.prod.outlook.com (2603:10b6:303:90::13) by MW3PR11MB4555.namprd11.prod.outlook.com (2603:10b6:303:2e::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3868.30; Fri, 26 Feb 2021 02:19:18 +0000 Received: from CO1PR11MB4849.namprd11.prod.outlook.com ([fe80::f598:e5a4:43da:794b]) by CO1PR11MB4849.namprd11.prod.outlook.com ([fe80::f598:e5a4:43da:794b%4]) with mapi id 15.20.3846.047; Fri, 26 Feb 2021 02:19:18 +0000 From: "Li, Meng" To: "linux-kernel@vger.kernel.org" , "broonie@kernel.org" , "rafael@kernel.org" Subject: RE: [PATCH] driver: regmap: set debugfs_name to NULL after it is freed Thread-Topic: [PATCH] driver: regmap: set debugfs_name to NULL after it is freed Thread-Index: AQHXC+VQbKvf23UuvUqged6OHJOU66pps3pQ Date: Fri, 26 Feb 2021 02:19:18 +0000 Message-ID: References: <20210226021537.7530-1-Meng.Li@windriver.com> In-Reply-To: <20210226021537.7530-1-Meng.Li@windriver.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=windriver.com; x-originating-ip: [147.11.252.42] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 3426c9ed-3c2a-4a53-8f96-08d8d9fcebbc x-ms-traffictypediagnostic: MW3PR11MB4555: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:590; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: CthQBAGEMtRPhc1cgv20tAOp0rHLMSMN7EXQ1+WGfdoC7mVSIrhCAHfi9DorgY1QMT2yd0a9U0ZFB5OgGw5ZVGLTQM6mudSFvVLIRoCqePdhXjpLMZMuKORevASgSfQeqrxhobXoeFqIsPE5hhSC2bWbvpOzznlmDFa/e++WPudJx/mLHXuvKQJrGHUflzxEk8DQNkK73veWvdLKgrcB+mZn85FTW11jY5P99y0tofva1QMmEwN28gdaRGQgYNzVyRj403i9HaBLV372wJIacTpwWaCNGHifRTqTa8kHnP0oJoRRiCHpOlI11PhJFqkCsNp1Eo96r97c3d5MKUJzl6YjxP0NBgwMGz1uhJjDE+6JCqMXSrQNFZejSTYeOhFg4ZmBKw02PTHGSnnFB57D2iSt71+knuMkfCwNKmX6V/Pql4EEFXjkHBYd/OqeACygzWYmadmntV2cxCpuY3HYwsQpu9HznQQxc4MW8Os6e2+62sz/nZNCht9BvEMM85jZw31mqt1UczaDjwdITweKZA== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO1PR11MB4849.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(376002)(136003)(366004)(39850400004)(396003)(346002)(55016002)(2906002)(76116006)(26005)(53546011)(8676002)(86362001)(186003)(71200400001)(9686003)(478600001)(6506007)(5660300002)(83380400001)(316002)(110136005)(66556008)(66476007)(66946007)(64756008)(7696005)(33656002)(8936002)(52536014)(66446008);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?Z2aVKvf4U9x/frQA+A9Tx36kNMS8QkT2FkSwIGbMJkLQeSW78Yoe45cFO7D/?= =?us-ascii?Q?iRNdigD7EN8e1D8FU5kncZivdypNs3wtFEi+BoiHOsvdjGlDqTTufpoA3bsX?= =?us-ascii?Q?7VmR7upWyXAcZ5xLEMVScviI9oLb+d7g7S5HxkBdOrf9TX3WeqSySX96K3sj?= =?us-ascii?Q?xEosrdflhq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02?= =?us-ascii?Q?6JhuYegZRzwdiTJO8m6PMWpQ1D/jGqJwLH/15PQKrkKwRvidZtUJOJDBZazB?= =?us-ascii?Q?gCi4Mfxp4+hgliR2C4HyV9k9FWJ4WYXY7BD3TGmBxf1wrP29WmuUBhGzX1Vh?= =?us-ascii?Q?WknTcJHGdwRjZwszGo10bG60SbNknPx+mBTCxjB6WvqaKI4dJpt7DJycCsbL?= =?us-ascii?Q?k5F3tfolrVhCj7K67ZuxuwtblAmiD1n3JCbZkjM1yLXvUUcEuOm3cltxB8Lc?= =?us-ascii?Q?TSdRTgvL0h67/F95RiAg3YE3?= x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: windriver.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CO1PR11MB4849.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3426c9ed-3c2a-4a53-8f96-08d8d9fcebbc X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Feb 2021 02:19:18.1460 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 8ddb2873-a1ad-4a18-ae4e-4644631433be X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: APPTRLch75dOzydTS8+7Gqs9Py2zIpo4bdSwXQsCTQsl4ygew9Fdn/h7AsSxqrw45iL5V9+gvlY/jLhEXKUHLQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR11MB4555 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Please discard this email. There is a wrong email address in TO list. I have sent another one. Thanks, Limeng > -----Original Message----- > From: Li, Meng > Sent: Friday, February 26, 2021 10:16 AM > To: linux-kernel@vger.kernel.org; broonie@kernel.org; > regkh@linuxfoundation.org; rafael@kernel.org > Cc: Li, Meng > Subject: [PATCH] driver: regmap: set debugfs_name to NULL after it is fre= ed >=20 > From: Meng Li >=20 > There is a upstream commit cffa4b2122f5("regmap:debugfs: > Fix a memory leak when calling regmap_attach_dev") that adds a if conditi= on > when create name for debugfs_name. > With below function invoking logical, debugfs_name is freed in > regmap_debugfs_exit(), but it is not created again because of the if > condition introduced by above commit. > regmap_reinit_cache() > regmap_debugfs_exit() > ... > regmap_debugfs_init() > So, set debugfs_name to NULL after it is freed. >=20 > Fixes: cffa4b2122f5("regmap: debugfs: Fix a memory leak when calling > regmap_attach_dev") > Cc: stable@vger.kernel.org > Signed-off-by: Meng Li > --- > drivers/base/regmap/regmap-debugfs.c | 1 + > 1 file changed, 1 insertion(+) >=20 > diff --git a/drivers/base/regmap/regmap-debugfs.c > b/drivers/base/regmap/regmap-debugfs.c > index 398991381e9a..4f2ff1b2b450 100644 > --- a/drivers/base/regmap/regmap-debugfs.c > +++ b/drivers/base/regmap/regmap-debugfs.c > @@ -661,6 +661,7 @@ void regmap_debugfs_exit(struct regmap *map) > regmap_debugfs_free_dump_cache(map); > mutex_unlock(&map->cache_lock); > kfree(map->debugfs_name); > + map->debugfs_name =3D NULL; > } else { > struct regmap_debugfs_node *node, *tmp; >=20 > -- > 2.17.1