Received: by 10.213.65.68 with SMTP id h4csp43575imn; Mon, 19 Mar 2018 18:59:34 -0700 (PDT) X-Google-Smtp-Source: AG47ELvZdWGeOS91T9lrEbNU7YXgociK922wXO7RznlIYcIroZrzBlPQo65PJ075R+Hfm0m2HgVV X-Received: by 10.101.100.200 with SMTP id t8mr10993868pgv.120.1521511174791; Mon, 19 Mar 2018 18:59:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521511174; cv=none; d=google.com; s=arc-20160816; b=ZNHXZsSyJFIa9wo+lGSSu7HvvBp1QEL1PpLSJT2n2zPNN1QXEccXwWzdbBrLnm66eY Y9wTk5FFCd/2c5P15mUJHBocpXg7PhNdQKiyX+zpOPte7RcV7Tr8fJw2SKfRfxWVoHXD sU433BfVNqQ7rMY43og+ErDR0Twpnic9Onsb3rco320StVSaSB9CfLbAyKGYeAGqzvgV cI8u/K9Pb9O63nRIb5X5rg3Etka5E4aCTJGnl5R1s0tvXyUvUa+y+lpHAs3lqk9jgOrG BrdelBHcgNx5ziL0nzCcOnVMPhWZ7BVFQxXlzTw5KF+N73tYarqygRgmQm49Ef0Jyqp5 7WIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=8dcXTe5D0q9YIjALq39K/3rKjkmLzfrk4px82axK21Q=; b=UWd8Ltijsr6dRm6bbmJ2NzTzQORUriTCW+bhBNMg0J3Xi9Ua1XlDrl/EU1/eCMG1yC 9ZQIvAERe5fWx1b9laitUuLGqSOwFPibRZtoy98yMCPeFzasFomKly7aUfEWnG/v1JhI Pq74t1hZSr1mEuRKw0Xzzcpt09l4QiQ3vJqrkiY06i2WPJBhbmVQtxnfTkhcoLt26nDd VXQOCKCMKmLPIfJhEdZrXGkNCA9IXDSYORyN4ow/jOhv36p8+azjWupFBvr4BBlxPD18 R1nyaAol3t83atn5cD4Y+JydrcBMg4mlJswOtSCWWde2z/7pcCDfee8Xks9OKdpGxqV6 1daA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=Yx1Hgke+; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j25si394163pgn.592.2018.03.19.18.59.21; Mon, 19 Mar 2018 18:59:34 -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; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=Yx1Hgke+; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S972414AbeCSWSe (ORCPT + 99 others); Mon, 19 Mar 2018 18:18:34 -0400 Received: from mail-bl2nam02on0123.outbound.protection.outlook.com ([104.47.38.123]:41056 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933943AbeCSPtp (ORCPT ); Mon, 19 Mar 2018 11:49:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=8dcXTe5D0q9YIjALq39K/3rKjkmLzfrk4px82axK21Q=; b=Yx1Hgke+AAhcm3dsWaiG+Qp2DJLwRde3KWEUWZDD1EGz22x6CYKqY2KcGY1940QDWa+10BHYWLfcI/8qiq4Dk+9vJpBXH15x4Lgb5x+ljY+4K89tc+RPFON5SNmUZwJJiAMNVVJHHmroDC+BGX/MbJMKPdZEjqmC1nUsviB/pSI= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1109.namprd21.prod.outlook.com (52.132.130.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.631.0; Mon, 19 Mar 2018 15:49:42 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::3d9b:79e7:94eb:5d62]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::3d9b:79e7:94eb:5d62%5]) with mapi id 15.20.0631.004; Mon, 19 Mar 2018 15:49:42 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Yintian Tao , Alex Deucher , Sasha Levin Subject: [PATCH AUTOSEL for 4.15 102/124] drm/amd/powerplay: fix memory leakage when reload (v2) Thread-Topic: [PATCH AUTOSEL for 4.15 102/124] drm/amd/powerplay: fix memory leakage when reload (v2) Thread-Index: AQHTv5nIsSj/6jRjPkeKjarkcWfbfA== Date: Mon, 19 Mar 2018 15:48:54 +0000 Message-ID: <20180319154645.11350-102-alexander.levin@microsoft.com> References: <20180319154645.11350-1-alexander.levin@microsoft.com> In-Reply-To: <20180319154645.11350-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB1109;7:19SZDM+Y7bZ5MQEnybqGTU4wMseK+d2C+rUjdJOBZ16VuMiVBcMIAdXPCprEMIlNE9M/ZW38F7WB+Y5gYBP2JjyTEtZfMPHLNecilU1md484427HruHSAChhHSqj3IEnNodsYxCaACFRPH8ftlCN80adASqPKsIs9ctzg/3uB61pkjfE+WyXV+2H+hHNP4DktUNXo24Jn/hS4a693E9Tnh+gWcX1oCEGIWk9+XzkmKZ9EMMPFvK4S04L6mtv2sv0;20:Mi5envtuezRVyzAPyjVf5oBKiQqy5M2LA1VTN/ozv3posJEYMC67wMr4AjI5gTzV3j/JVhK2VTu7MiCW1t2Naap9Ms6c5vR39MB8p1Egzmu0Dd+WHbPLiok83bz2EPb7BOuIiBuRe2p5dv6M5ZhLfW+9VGCmeAHp2ANzG+IGiAU= x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 1a71e0b1-b8bc-4155-9679-08d58db107e6 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB1109; x-ms-traffictypediagnostic: DM5PR2101MB1109: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(767451399110); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(5005006)(8121501046)(3231221)(944501300)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(61426038)(61427038)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(20161123558120)(6072148)(201708071742011);SRVR:DM5PR2101MB1109;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB1109; x-forefront-prvs: 06167FAD59 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(366004)(396003)(39860400002)(39380400002)(376002)(346002)(199004)(189003)(81166006)(10290500003)(107886003)(81156014)(106356001)(6506007)(8676002)(3846002)(36756003)(8936002)(97736004)(6116002)(1076002)(102836004)(68736007)(6666003)(3280700002)(2950100002)(3660700001)(478600001)(72206003)(59450400001)(2906002)(14454004)(76176011)(66066001)(8666007)(6512007)(5250100002)(10090500001)(2501003)(53936002)(6486002)(6436002)(26005)(316002)(22452003)(305945005)(7736002)(4326008)(25786009)(86362001)(86612001)(5660300001)(2900100001)(99286004)(54906003)(186003)(105586002)(110136005)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB1109;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: Q10n96gGoy6yIv8EHG3dGbcTc8/Ex3J0o3dyrHlAnmmlhspytKLP9iKr0pumWq/WZXnAr/S6/cl00idvYZu41gpCyJdiOj12SiR7tl+c+lX/Jp10qqpwJfhMe/n65elZiq8IUy3VinMhr8yeIwqw9UbWm4MpzbXlhZ6t0xEllnoYnbMlm1RC87jHlux2mP1Sr6b34Pi1BIvgrCiu8/SQ1YqnJFPDSGWXPfvnbMIg1PYTT29J+f+9dZh0e61SS+vmrIv4lWA30jEI/ggGbz2ieohi/joQ6WeLHv1q3HcE9yIDJe3pV3mCXVWcd91MCkyBvELwBRJcDNazoE7kqV0mZg== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1a71e0b1-b8bc-4155-9679-08d58db107e6 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Mar 2018 15:48:54.0755 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1109 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yintian Tao [ Upstream commit a25513e7b9b15c318ec44113682e988829aef746 ] add smu_free_memory when smu fini to prevent memory leakage v2: squash in typo fix (Yintian) and warning (Harry) Signed-off-by: Yintian Tao Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.c b/drivers/g= pu/drm/amd/powerplay/smumgr/smu7_smumgr.c index 7f5359a97ef2..885d9d802670 100644 --- a/drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.c +++ b/drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.c @@ -648,6 +648,12 @@ int smu7_init(struct pp_hwmgr *hwmgr) =20 int smu7_smu_fini(struct pp_hwmgr *hwmgr) { + struct smu7_smumgr *smu_data =3D (struct smu7_smumgr *)(hwmgr->smu_backen= d); + + smu_free_memory(hwmgr->device, (void *) smu_data->header_buffer.handle); + if (!cgs_is_virtualization_enabled(hwmgr->device)) + smu_free_memory(hwmgr->device, (void *) smu_data->smu_buffer.handle); + kfree(hwmgr->smu_backend); hwmgr->smu_backend =3D NULL; cgs_rel_firmware(hwmgr->device, CGS_UCODE_ID_SMU); --=20 2.14.1