Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp975321rwi; Wed, 19 Oct 2022 05:22:53 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7bIt7XYZYsZ1OxccQLA0cHjHf9Ztx3zq3Yg65+mX5nEH21qFsXfNOxOy9iqC4liu5+hqjk X-Received: by 2002:a63:82c6:0:b0:46a:deff:7691 with SMTP id w189-20020a6382c6000000b0046adeff7691mr7108154pgd.214.1666182173356; Wed, 19 Oct 2022 05:22:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666182173; cv=none; d=google.com; s=arc-20160816; b=ajw5kLUGl4+LV1oRTgrCcSKa7lEX4IEJzgUqF6hoChWe7gB6Jra+Rwzz/NVr0zQa+A gxhUBFlpK85JvaCEusOLtrPHU4B3ns4jbUiJNnb5sRLcM4/WSg7fjRVPZVxndUcYHxeM naCvrVmevgIi1VqBObG8pCceZLMKHJzizkUeplWBRPobtTgi51WlEFqa90PHK8+LpyHR AFSXASLumK7ccSSkfWA5tsh/5GUvTHZaAC47KxLL5PyVL9GbfedTzdyi0QzPtZA2E/Hq 1L3oMAdz1vB8lyzb1yC0ARuGZ8rkE+rBKzkBawTY2p/vpbX54aAuR1o1MvuKxb1GE2IK WeFQ== 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=pYwhLFZiUeP2h3tEcszipLvkPOELhk0OpaIfhgBrjww=; b=wNRv+ZIyyRgM3KFmImxQ1puCoFO4Mg/Y1L4QIacHm90M3zvZ2rDGb2D3indjGJFFHJ tIzgsV/J+75Qt86ITvN1y/R0YCizdaHEGTABdnCeosRXwclYM76nS+GnC8JAClgZtj2D Qu6V/wTUCdOLwp8HXQFbRAWnEur/JbmE+zoXcoKM0F8qhyNXdeun8m0+5BdRjnlL12Lh eiHgD37hBb3z4CI6WhAabide5W1ROH8grkI+3fM5Oee/vToydFqHHR2Td1bjf2gle1OP WLidbxxSHKueJEenjFNgH8T0/rjx/6XcBwU2M5kPKjGAMGLjY6u3O0eDAE64tizCBP64 Sv/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pZrrTJgj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p2-20020a170902b08200b00180556e1b6bsi17294520plr.609.2022.10.19.05.22.28; Wed, 19 Oct 2022 05:22:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pZrrTJgj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232096AbiJSL4l (ORCPT + 99 others); Wed, 19 Oct 2022 07:56:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231512AbiJSLzo (ORCPT ); Wed, 19 Oct 2022 07:55:44 -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 1FE8423E94; Wed, 19 Oct 2022 04:34:41 -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 32A38B823B9; Wed, 19 Oct 2022 08:53:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 99B43C433D6; Wed, 19 Oct 2022 08:53:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666169630; bh=QhYu81M8WtAo05jbsad99FIeUifFSmuabQ0GNCOz7wI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pZrrTJgjFSvo6CRT8Qu87FCHPcHzS4fFPz+SVWRY//zoXQxIL00kB64cKBy0URuC/ vwsBcT9iq5qS0Sj+6J6uQfcFEsqHEoFUWDfpEkebRyG8uPyCgLady0M3dEU8EejUru xbcTNNW40s7j0LymleL82XJevpejdoM2jATjhYRw= 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 6.0 349/862] drm/mipi-dsi: Detach devices when removing the host Date: Wed, 19 Oct 2022 10:27:16 +0200 Message-Id: <20221019083305.464236614@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 c40bde96cfdf..c317ee9fa445 100644 --- a/drivers/gpu/drm/drm_mipi_dsi.c +++ b/drivers/gpu/drm/drm_mipi_dsi.c @@ -346,6 +346,7 @@ static int mipi_dsi_remove_device_fn(struct device *dev, void *priv) { struct mipi_dsi_device *dsi = to_mipi_dsi_device(dev); + mipi_dsi_detach(dsi); mipi_dsi_device_unregister(dsi); return 0; -- 2.35.1