From nobody Fri Dec 19 17:33:00 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E4C55ECAAA1 for ; Mon, 24 Oct 2022 16:08:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233443AbiJXQIQ (ORCPT ); Mon, 24 Oct 2022 12:08:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233338AbiJXQE2 (ORCPT ); Mon, 24 Oct 2022 12:04:28 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 83F032655E; Mon, 24 Oct 2022 07:57:10 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 7808BB81620; Mon, 24 Oct 2022 12:22:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D6358C433C1; Mon, 24 Oct 2022 12:22:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666614132; bh=w37r33LIb9FKUf6H97lfeWvSi5XF2Tniw+6hjdytPr4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=S5FeFbQnw6KlFxsoRm9FHtII+Lsc418GE6m02vPVlDn8uNd1gJUR8XQsAdT44R8sS 0BMuYMNnF0IO0DXTxKuFQ6symKJqFaXFgk39GDCrm726KMRrxfIdvXsdI9CitGfSJO 7ygeLMr00PZwUU5DnY+Tx8rbJr+92Rd04kVngHas= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Thomas Zimmermann , Maxime Ripard , Sasha Levin Subject: [PATCH 5.10 143/390] drm/mipi-dsi: Detach devices when removing the host Date: Mon, 24 Oct 2022 13:29:00 +0200 Message-Id: <20221024113028.765547276@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113022.510008560@linuxfoundation.org> References: <20221024113022.510008560@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Maxime Ripard [ Upstream commit 668a8f17b5290d04ef7343636a5588a0692731a1 ] Whenever the MIPI-DSI host is unregistered, the code of mipi_dsi_host_unregister() loops over every device currently found on that bus and will unregister it. However, it doesn't detach it from the bus first, which leads to all kind of resource leaks if the host wants to perform some clean up whenever a device is detached. Fixes: 068a00233969 ("drm: Add MIPI DSI bus support") Acked-by: Thomas Zimmermann Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-2-maxime@cerno.tech Signed-off-by: Sasha Levin --- drivers/gpu/drm/drm_mipi_dsi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/drm_mipi_dsi.c b/drivers/gpu/drm/drm_mipi_dsi.c index 5dd475e82995..2c43d54766f3 100644 --- a/drivers/gpu/drm/drm_mipi_dsi.c +++ b/drivers/gpu/drm/drm_mipi_dsi.c @@ -300,6 +300,7 @@ static int mipi_dsi_remove_device_fn(struct device *dev= , void *priv) { struct mipi_dsi_device *dsi =3D to_mipi_dsi_device(dev); =20 + mipi_dsi_detach(dsi); mipi_dsi_device_unregister(dsi); =20 return 0; --=20 2.35.1