Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp161365pxb; Thu, 14 Jan 2021 23:04:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJyRPObNyD7B73RIML2MUH4lyPQJxrBvcKr1hukIyqTVF2kVllGUhnGgxUko4qSNmR8ZBrND X-Received: by 2002:aa7:da03:: with SMTP id r3mr8376905eds.155.1610694265401; Thu, 14 Jan 2021 23:04:25 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1610694265; cv=pass; d=google.com; s=arc-20160816; b=ug8NRaPDcKAsaUl91SUHTmlbGt8aAly55YbQm69S5ydcNkfDFo2hHneQ5FsfQUic+a FNxNMJwYSN3yeVp8L49wavTZKQjNOmB+he8RS0r4xCX1/O9UE4d5RsyIRqjUsH5vnZge YUDaxQ5jt2IfC+5ssKNLCV2e2jA1jYNg0nW7QDWoevXkjJt28f+ZfAP3mcj/0Qo91W4Y itOjvtgVZPZ1mlO4yDO3ygL1G0BaIJoZD0pjrtobu7YBzZmOovvkzsSu6NwiVInQYCBO Ds14iBVYW9XoKe2pg5YYTTm0elAQ1iOho31V7RLTIrdlkvJ2v0ef0TOoqkyCiDFDFPxO FX/w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :dkim-signature; bh=AZq3BFPqy7tsxIdHNZ75A6IwzSF2HMgoWjUP7WB7opY=; b=XqNrer+LV+T5opq17WWS3uhfyA57kBpBV0bBbCIcN/Jv/U2EmpQ7jM5VDH8aEcDk01 icmIpc2BV63XtfFR0FkI6Vmhso4SSlOn3x9kje8y2QIJmtADYMhwyz88KGRhoFjt7CjB 2U9UZCYgcYHkD8Dj+uDRGu8WubfH7mXA88aq7PqL45Uy6FMwtJKnyWh9Iqgm5KFaqOwD xOG6R5OjG0p8EmOZjbYlVp3mRXLwa2sU8CU0rLGRYr61G0/zrAE1cmxlUUTgAzgyniQw cE1S+//UBGBTDh/rXVgs9MOEKzCmB0mXv8WG0eLodc9X3yHMLpfN8HgkJvB3VpT48Ulk vJUg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@windriversystems.onmicrosoft.com header.s=selector2-windriversystems-onmicrosoft-com header.b=qH32bGZA; 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 k27si3233091ejg.317.2021.01.14.23.04.01; Thu, 14 Jan 2021 23:04:25 -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=qH32bGZA; 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 S1731707AbhAOBwA (ORCPT + 99 others); Thu, 14 Jan 2021 20:52:00 -0500 Received: from mail-bn7nam10on2042.outbound.protection.outlook.com ([40.107.92.42]:60001 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731602AbhAOBv6 (ORCPT ); Thu, 14 Jan 2021 20:51:58 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nCuTTnmV48+3W9BcUI5C5sZyVIQYHPbg5pPktE9xVRuGBheLupZR6F9X8p+/McU34GqhSVbF/nEAEqu+fy8V7sINJthycJREEXRblwXqY++YAuNJImVXkLWnBAyw5XkvE/1RQY6bbinV8SqHTsefLIVKWMcJRmpmrMPgQqMvP/u9TCVZungc8dBS4s321UTtQkHt4U9gwO9rgRwNWz8SIG34RCpA2zhND4d05Aqvn5N60YcYEqKgGLrEET+2fHFP18IWremgxr+10LKjANuQ+IswfUxmnS42QkDO0oGWyWNOaIlZwzXJhAAlpQfDV+IAN3jv4edJPY1U0zcIffbi6A== 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=AZq3BFPqy7tsxIdHNZ75A6IwzSF2HMgoWjUP7WB7opY=; b=ONYqiSWlBpi/nJZJVOs/wgCUoFAQpfX4qJfaCmnzJfWOuKF4zx5HA6DMdczmjE5pSgV8ouy4pG6O4BM56GXpwdwPIJ5BX5ijNOSL4ng4RNu7JpHyYYJ36ULN6x6MwmNizm33eGtLNPAFk3Fh+yWcO+jhJa6U28BIb5OJmQgQqfqTIMxgWkU07OFIdtgKKQuiolPaYbKKpW42CCXBY+FxowzDKvMspPdzf55sQB3k3sCY4ndxrLKadI31v9b/lCV3BCdyvKkv2fIHePBGYC3hiFX2pGvM7bX7pkB74wdCZKiRq44J+0oLcLpIiF2GKnTJCpN9Vz/T1CVpIkH2TyDRdg== 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=AZq3BFPqy7tsxIdHNZ75A6IwzSF2HMgoWjUP7WB7opY=; b=qH32bGZAf6tLvbUv5N+cfgYvG4MSrt8rf91kThWz0ee1fni3ODWqT3dmSwpS7a5qBYufApnOqhoCqMpzLDktnCqzOEVLf0oNwkmtoFDlQVfsqNtmHiExH4WG6ouVgf+ZnEarwt+Za7aJbPdAntOS7GSNatOegdhJOMkeh2Cq6eM= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=windriver.com; Received: from SJ0PR11MB5072.namprd11.prod.outlook.com (2603:10b6:a03:2db::18) by BYAPR11MB2741.namprd11.prod.outlook.com (2603:10b6:a02:bf::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3742.12; Fri, 15 Jan 2021 01:51:10 +0000 Received: from SJ0PR11MB5072.namprd11.prod.outlook.com ([fe80::4934:bf21:e093:8c3e]) by SJ0PR11MB5072.namprd11.prod.outlook.com ([fe80::4934:bf21:e093:8c3e%6]) with mapi id 15.20.3763.011; Fri, 15 Jan 2021 01:51:10 +0000 From: meng.li@windriver.com To: linux-kernel@vger.kernel.org Cc: maz@kernel.org, lee.jones@linaro.org, arnd@arndb.de, Kexin.Hao@windriver.com, meng.li@windriver.com Subject: [v2][PATCH] Revert "mfd: syscon: Don't free allocated name for regmap_config" Date: Fri, 15 Jan 2021 09:50:50 +0800 Message-Id: <20210115015050.26657-1-meng.li@windriver.com> X-Mailer: git-send-email 2.17.1 Content-Type: text/plain X-Originating-IP: [60.247.85.82] X-ClientProxiedBy: HKAPR03CA0009.apcprd03.prod.outlook.com (2603:1096:203:c8::14) To SJ0PR11MB5072.namprd11.prod.outlook.com (2603:10b6:a03:2db::18) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pek-lpggp4.wrs.com (60.247.85.82) by HKAPR03CA0009.apcprd03.prod.outlook.com (2603:1096:203:c8::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3784.6 via Frontend Transport; Fri, 15 Jan 2021 01:51:07 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 121f9d6f-56fe-481a-f27f-08d8b8f80839 X-MS-TrafficTypeDiagnostic: BYAPR11MB2741: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1002; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: polIExD5dmxMRNk/B3mDmBLeKQ9++DcOamceWqIIilPr1LejoUQ7hARPXdZHh/p4iLTjfqWPInyBCYYmJjmoowyksVc0fSLDKKysWQ5Hf7vzdgOZNykY6YKB8g3WHmU7FNB3NO9JDf8SalsqLHpjbp2ZztVrkd3dHks9/5NP84kqcOGCicniiBJ02AAV0G3jwjSSuuSv8MScOqFzjfF5kaPT+G8PWrSou0OdFk3ccemJ72vA1vlFmn4y58f4R8q5ryN7CvubUAUIS3YXBJdrcyCziOOtvy+uRaFIaPcZzXypxTe6eiS0nW6JG7C5zSzIslYfmTfde3nhFPjo5qdrvIaWT749qSrIK30lbXn90swob6GPCA1z93fjpwFd06SXZPsyf71r5a2geWTBY3o1jg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR11MB5072.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(396003)(39850400004)(376002)(136003)(366004)(346002)(478600001)(36756003)(66476007)(956004)(66556008)(6512007)(16526019)(8936002)(186003)(316002)(6486002)(2906002)(6916009)(107886003)(83380400001)(4326008)(86362001)(8676002)(6666004)(1076003)(66946007)(26005)(2616005)(6506007)(52116002)(9686003)(5660300002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?QeU/zO1f3Di4Uod/e1t0O3AkhhEygz+8+NdpSC43F/uM9WJlzUtK6xMOVDVq?= =?us-ascii?Q?WNso2vgrxXRQJ9JtTdH5LJ1YAYubuJA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F4ViafKqOVr+5zpbF4V4GmSLM+YDV1Ep9LG2ZXhuoWFY?= =?us-ascii?Q?8cO4?= X-OriginatorOrg: windriver.com X-MS-Exchange-CrossTenant-AuthSource: SJ0PR11MB5072.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jan 2021 01:51:10.1245 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ddb2873-a1ad-4a18-ae4e-4644631433be X-MS-Exchange-CrossTenant-Network-Message-Id: 121f9d6f-56fe-481a-f27f-08d8b8f80839 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 2CbJNm1DYTp/AeJd7f2bLSUv5uTr/MtC6JOS8XZ0KOhFRsAkGG3l1Hj7c6oh1a2/ERHAOblSWvWntR9t6/8SAA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB2741 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Limeng This reverts commit 529a1101212a785c5df92c314b0e718287150c3b. The reverted patch moves the memory free to error path, but introduce a memory leak. There is another commit 94cc89eb8fa5("regmap: debugfs: Fix handling of name string for debugfs init delays") fixing this debugfs init issue from root cause. With this fixing, the name field in struct regmap_debugfs_node is removed. When initialize debugfs for syscon driver, the name field of struct regmap_config is not used anymore. So, revert this patch directly to avoid memory leak. v2: Notify the author of the reverted commit by adding Cc: Fixes: 529a1101212a("mfd: syscon: Don't free allocated name for regmap_config") Cc: Marc Zyngier Cc: stable@vger.kernel.org Signed-off-by: Meng Li --- drivers/mfd/syscon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mfd/syscon.c b/drivers/mfd/syscon.c index ca465794ea9c..df5cebb372a5 100644 --- a/drivers/mfd/syscon.c +++ b/drivers/mfd/syscon.c @@ -108,6 +108,7 @@ static struct syscon *of_syscon_register(struct device_node *np, bool check_clk) syscon_config.max_register = resource_size(&res) - reg_io_width; regmap = regmap_init_mmio(NULL, base, &syscon_config); + kfree(syscon_config.name); if (IS_ERR(regmap)) { pr_err("regmap init failed\n"); ret = PTR_ERR(regmap); @@ -144,7 +145,6 @@ static struct syscon *of_syscon_register(struct device_node *np, bool check_clk) regmap_exit(regmap); err_regmap: iounmap(base); - kfree(syscon_config.name); err_map: kfree(syscon); return ERR_PTR(ret); -- 2.17.1