From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CE1D4346E55 for ; Sun, 5 Jul 2026 12:01:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783252900; cv=none; b=eTmKRDT4MLhJzqAS61WIWJ4z0OL7bgbR91CR04h6BXBF3vIHrafW0xpp3mKmH9kanXh7mvxFvCzga3LN1MKR1qSVVVPqvEOucdTTpmfd/ne9wRHRiTqgQ5goTVpBheBlUx5xrp0h86kkQjNCh6VjMh0Kek4jPESWUZUo3VPDXMU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783252900; c=relaxed/simple; bh=9S5fXQseOT7me9SAp3TfOhAW4haC3quCDaBackywBow=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Hk1qef2Ttegp3oh3u11E0mmdq1DMfGjjBs+GuYjnbONxKTmVRzakMwdTr5NQs2v+3qUwVSCoZF4fefvgpYXkPWcvO6XweZnExzDHKBzJiZQkxDZJ9UHtLry8VSM45iziUASlej9AhBdpsNnhatV/Ir7cd9jUwckBQdYuS51egLI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=d7HINp2y; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="d7HINp2y" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 58D151F000E9; Sun, 5 Jul 2026 12:01:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1783252899; bh=8VB/Yde9WwUZSzHZNla+a60srDPe+CyYZ3Qn4u6zv1U=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=d7HINp2y+EbqNdMnO9hjINkAv1BTljVXoU9l/WQkQylgqp1wUqygEwKuykG4iF/TO oBHZIuEZGTiKKxP/vO1bsyvQCd8uoCYkDQDuLGLs21awr0o8gLYA8M5dLpmFFEnoZF yXnJ/3UbOWi2qbjLhMWThhR1cK3YIx1CQNIuz3NVlWqxv7LQjjwhl+dnDkO3WfePkg O2h22C5QJUtsIjJPQkNUyDkC0Luq8xuLJ4vmMxon6UuKomitHxqm+K/ZbPFift0HAa X9LV7W8D5bZQ7yR+aOGYI70QVWsWt/vQ5R7I5widBxjVeg7hGgeg4nFX35UmVxRLbc RAVB2W8TqgdOw== Received: from johan by xi.lan with local (Exim 4.99.4) (envelope-from ) id 1wgLXU-00000001PSw-45fs; Sun, 05 Jul 2026 14:01:36 +0200 Date: Sun, 5 Jul 2026 14:01:36 +0200 From: Johan Hovold To: Guangshuo Li Cc: Chun-Kuang Hu , Philipp Zabel , David Airlie , Simona Vetter , Matthias Brugger , AngeloGioacchino Del Regno , dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] drm/mediatek: mtk_hdmi: Fix DDC adapter double put in v2 Message-ID: References: <20260704174113.255485-1-lgs201920130244@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260704174113.255485-1-lgs201920130244@gmail.com> On Sun, Jul 05, 2026 at 01:41:13AM +0800, Guangshuo Li wrote: > mtk_hdmi_common_probe() gets the DDC adapter with > of_find_i2c_adapter_by_node() and registers a devm action to release the > adapter device reference with put_device(). > > The HDMI v2 remove callback also calls i2c_put_adapter() on the same DDC > adapter. This is not paired with the find helper and it drops the adapter > device reference before the devm action drops it again. You should mention that i2c_put_adapter() also puts a module reference that was never taken (of_find_i2c_adapter_by_node() does not take a module reference, unlike of_get_i2c_adapter_by_node()). > Remove the extra i2c_put_adapter() call from the HDMI v2 remove callback > and let the common devm action release the adapter device reference. > > Fixes: 9545bae5c8ac ("drm/mediatek: mtk_hdmi: Fix probe device leaks") This is clearly not the change that introduced the issue as this driver did not exist when it was merged. This should be: Fixes: 8d0f79886273 ("drm/mediatek: Introduce HDMI/DDC v2 for MT8195/MT8188") You should also CC stable. > Signed-off-by: Guangshuo Li > --- > drivers/gpu/drm/mediatek/mtk_hdmi_v2.c | 3 --- > 1 file changed, 3 deletions(-) > > diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi_v2.c b/drivers/gpu/drm/mediatek/mtk_hdmi_v2.c > index 7bbf463056c9..e668506daf67 100644 > --- a/drivers/gpu/drm/mediatek/mtk_hdmi_v2.c > +++ b/drivers/gpu/drm/mediatek/mtk_hdmi_v2.c > @@ -1501,9 +1501,6 @@ static int mtk_hdmi_v2_probe(struct platform_device *pdev) > > static void mtk_hdmi_v2_remove(struct platform_device *pdev) > { > - struct mtk_hdmi *hdmi = platform_get_drvdata(pdev); > - > - i2c_put_adapter(hdmi->ddc_adpt); > } There's no point in keeping the empty remove() callback. > static const struct of_device_id mtk_drm_hdmi_v2_of_ids[] = { Johan