Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp805105pxb; Tue, 3 Nov 2020 13:02:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJyEP2ZASG4SlBmjQXLwsDgXy5BCDtJG4ZBFU8FOJ0pG0rL92jYITJtAJzF077BKDk0Fyt7L X-Received: by 2002:a05:6402:4cb:: with SMTP id n11mr23424822edw.296.1604437345492; Tue, 03 Nov 2020 13:02:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604437345; cv=none; d=google.com; s=arc-20160816; b=PIou/YgCTruy+/rL+Tphxyn0xIBPfgU5EHw/DxSytOqZWxkobi7foiXbJUZ8yzX572 dr1RMcSzHTEOnUy6fIoObjy5Mfw3S7saksb20zoCmQkLs7bJVgHs9+oiZY1ik1rwHTio CrCc7hDsPhmRMeVPHR++GSj9ATxe9v2l6TsTAp+1KNmyUZfEREKYvtdFwJJJ0qN5A+zY WCYhuN6ltWutqKd9tWaiRdQG7KdijpTU7CqJvJb58W8RW3cmoPWDRoQIlM4M7gQNZK5L 30sHiqkGxfydyR1kmgjnLddqhk8CchCJBBM5ybf4v7A1NYO3Z3KfOf3kKDeB3lZ/CD0P 3fBA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Id6c52Yqciv+/Dt5HU3u9cP8ZIVANcZ/zVUEXlP3sz8=; b=dz+6nDHzCd9V7v4f8ty0CVkPc1YwggiUcmoZGeunF1+HV1RpC+rw3zlgRw9GHo70ZK cyWS3xnqyde4F/kORD7epj+PJkLhOSzJ3RQCNhfYW+ybCJZGVjI4lqjT6CyGOpqcUKtI eU0QxGdBmMJ7yXUFjrORvlLIppIbdpu68pq9NDnjWsKeQDpc0G2erNo/EWc6qJL7ecye vYAYkYwB/RFPqFw5TRrOT+fs2Ck7EK0tE2ukZJKaWhT12vrSGQrhCva1FTsyg6nj+8g+ k+HEU4OLJof6RIXxAOloEl+1CErVvte1H//45VWi31H2roW+Siee2/w6VeS0MDjbE2q7 Ciuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JjwC6anB; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u17si1962ejm.227.2020.11.03.13.02.02; Tue, 03 Nov 2020 13:02: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=@kernel.org header.s=default header.b=JjwC6anB; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733153AbgKCU7s (ORCPT + 99 others); Tue, 3 Nov 2020 15:59:48 -0500 Received: from mail.kernel.org ([198.145.29.99]:35110 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733148AbgKCU7q (ORCPT ); Tue, 3 Nov 2020 15:59:46 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 66BA522226; Tue, 3 Nov 2020 20:59:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604437185; bh=VN2joP1QwjsTsFMr9W1EBaKAcBuzynY8faArlkwSbJo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JjwC6anBCamWjrl/E+fc2gRkXVEkS/1M4fhZmerbQANbwAbqaXKNtDdLCUWF/eMvc cvYgx01/EZQxOceWH8ptNd2I6PMXvrJecAh381k4vV/olQw0Ih44K9vHH1CgTMejIM mbv+0CGr8fWN2UMA3oBNrkBqEfWCFBoVkCM1h9wU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nicholas Kazlauskas , Andrey Grodzovsky , Alex Deucher Subject: [PATCH 5.4 183/214] drm/amd/display: Avoid MST manager resource leak. Date: Tue, 3 Nov 2020 21:37:11 +0100 Message-Id: <20201103203307.859116601@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201103203249.448706377@linuxfoundation.org> References: <20201103203249.448706377@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andrey Grodzovsky commit 5dff80bdce9e385af5716ed083f9e33e814484ab upstream. On connector destruction call drm_dp_mst_topology_mgr_destroy to release resources allocated in drm_dp_mst_topology_mgr_init. Do it only if MST manager was initilized before otherwsie a crash is seen on driver unload/device unplug. Reviewed-by: Nicholas Kazlauskas Signed-off-by: Andrey Grodzovsky Acked-by: Alex Deucher Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 7 +++++++ 1 file changed, 7 insertions(+) --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -3956,6 +3956,13 @@ static void amdgpu_dm_connector_destroy( struct amdgpu_device *adev = connector->dev->dev_private; struct amdgpu_display_manager *dm = &adev->dm; + /* + * Call only if mst_mgr was iniitalized before since it's not done + * for all connector types. + */ + if (aconnector->mst_mgr.dev) + drm_dp_mst_topology_mgr_destroy(&aconnector->mst_mgr); + #if defined(CONFIG_BACKLIGHT_CLASS_DEVICE) ||\ defined(CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE)