Received: by 10.192.165.156 with SMTP id m28csp67560imm; Tue, 10 Apr 2018 16:34:26 -0700 (PDT) X-Google-Smtp-Source: AIpwx48lwAw8gy1jsYqevU5Mv9ipO4HiClQ1WC+0ggR+RH8hXlS584RO1ZopPJwhiQ18wvQRm1gO X-Received: by 10.101.64.66 with SMTP id h2mr1672342pgp.5.1523403266465; Tue, 10 Apr 2018 16:34:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523403266; cv=none; d=google.com; s=arc-20160816; b=h5Pz4f5QBhRhKYjja2Wh312cf1oibS7F7or9TkAVQPhbSWby7R/XapQqKP47yg47xT cLX0guVhnK/RkZA5UnSh/7AjBozE7FxaXlS7J6351FgJ6Fy20HKaACUlxL2hmlTakgih CSeCXeOG85pL0oPShLOXYyP7fk0sTmNKEhWwrwRFWxcYELqdUOqfkQnxPOvctTklHNJC biyLPx7ougxWRt9JUQTF4TGREN+mTnBMtH4tYB3ATmzXpyuXqqoAkQuVy7ph2onGPYYM 6xhZz5saVSf+tSK4L1VBZg0kJaNE7F5nHNFjpNYCxSoZJbkZZ+ttSofTXlU9gbYNNAmB LbYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=rfR/oYd0B8Ja1ZQQnd8R8HDBNC5ypBgn3ufXVywj0A8=; b=R0L2B3bSMpERYq7awDTpo/oALSjd1/L+HBaF0i83gSKy5gcfUlHR6pS45NvFPOoN+f knpcI39WU/m5RNZPk+oMbXaT979njEy9c8skAHhmpg9oNVlaeHLa3qGqpuuFYcxuRHKg JMl/vvU11/NhM+GFpbk9aDw4zd8WYAZsrbYJUPqp8CLmAJ3EZn7xTaOgABmRZbBdW/IP wfIZLkaBwUGO/6HZ8YOyHwBrgNJ8duSNok5qHwUX8mGojgObWd5io1i9NgM9txNlkHBi mfs8FoaNU810rJAAz63YcPkJiRTjeoB4FD81g4rm9ePMphEmwH48VIMVWpw1QYj6wHik 3x7Q== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e32-v6si3722103plb.135.2018.04.10.16.33.50; Tue, 10 Apr 2018 16:34:26 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754422AbeDJW3y (ORCPT + 99 others); Tue, 10 Apr 2018 18:29:54 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:39752 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754404AbeDJW3x (ORCPT ); Tue, 10 Apr 2018 18:29:53 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 6C910D59; Tue, 10 Apr 2018 22:29:52 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yintian Tao , Alex Deucher , Sasha Levin Subject: [PATCH 4.15 091/168] drm/amd/powerplay: fix memory leakage when reload (v2) Date: Wed, 11 Apr 2018 00:23:53 +0200 Message-Id: <20180410212804.132870137@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180410212800.144079021@linuxfoundation.org> References: <20180410212800.144079021@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.15-stable review patch. If anyone has any objections, please let me know. ------------------ 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 Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.c | 6 ++++++ 1 file changed, 6 insertions(+) --- 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) int smu7_smu_fini(struct pp_hwmgr *hwmgr) { + struct smu7_smumgr *smu_data = (struct smu7_smumgr *)(hwmgr->smu_backend); + + 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 = NULL; cgs_rel_firmware(hwmgr->device, CGS_UCODE_ID_SMU);