From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f172.google.com (mail-pf1-f172.google.com [209.85.210.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2A9F521D596 for ; Mon, 6 Jul 2026 01:55:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783302952; cv=none; b=XGPGuUVHFcENz2lBZmRkWGkcT/Wm1gVJ+rJSxJRN6XD3RJKxJOU3vrqJJtK18TZOAhlYE2IOMPthRd2MIeJqlxXjMQ/U2CuvO5lsqUibU7GDrpN2M8/isYHmG/P+yUH0G/6k6LYu8PTrk54MZ+HvNDmkeZUemVsvdTbG8s6JNsk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783302952; c=relaxed/simple; bh=fke5d2bOur5p1Gx0fsd1ETls+k12o1A0rrGDjqUrOp4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Wv173vxxxPMDv9LgF5QHFMnMygNveUNUeUo/wodHOn73YKJjayv/Cv7TSW8/1I73aEDYni9ZAGKaOPob3iUFDj4oeV2tqXBzCcPwxddJgPxVgrUps5b2iZvUR9xp5LOlHYo74r2yJNIsQlzZWRhArK0SM5ms389Z9hzVzsJPeNc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=p5mLEo0c; arc=none smtp.client-ip=209.85.210.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="p5mLEo0c" Received: by mail-pf1-f172.google.com with SMTP id d2e1a72fcca58-845ea8924fdso2720766b3a.0 for ; Sun, 05 Jul 2026 18:55:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1783302950; x=1783907750; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=hc+/IIfPHTQ5W3C46gmAKHbZoREmTGGCL3gylifCnJk=; b=p5mLEo0cCf0pk0O0GQmc17Po/IG2mp270CchGafORTRjaKHAaE9a3Os40zxEpUeKZ7 QbsNN5Ww3hYjhjMvJ+K3DUPEmIst/MGvqSJpfbrn8KBIb3m80SEB2E7zznewZ1UEB1Uy LY0PJO6wzhgwJGX4ME4plh1YFQc9wQTyv83BBpyaco6vXUsDOqQMMHMoTc4GSqsUKGMY bEtKoSByGPgOMaKyW5mmP/+lbyjKezv7FOeXxfAj+UF9RrWPqzGXxCl+WGlG0wZsY8Pg dOIbtrjnx0mzjnnC55iXu0snTvgMUql2fnXmLzN7lUAqhEgpqMEbIRxRqK2E5Iolq+iW g/qQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783302950; x=1783907750; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=hc+/IIfPHTQ5W3C46gmAKHbZoREmTGGCL3gylifCnJk=; b=Xon8nWydcbVloSs2Wki38ppV4Ab3+kmwLWmp8qKENAIvJWnQJdYSWhPV3ewtLE+mKf 32t1VNrs1Zk55CvVWCfnWcp41fyV1yfWLG5N/K9RS3d8aDdpzZyVnKw9Es2HZDJtVCfF 6RC2Vjos19vnpbQD0hCctlAGSaVmdXPLoluQlWAYS9wwZMuamDZwl7TqiYxiWX5oOjwa 7oOTTQJWntlQIUDxFWV9APeNfmqy7gQKI4ovVTKQ16o0/O0gzXvFGyczcYs8dlOxNpIf ykQ7Fve0HPmI5oyjxDir8ZdpMiqnF/FFYFPzthSIH2wC/fwUH1+5s5hyVJhxSZcTqVyu vaVg== X-Forwarded-Encrypted: i=1; AHgh+Rr+v9y5quBFlwIcohuLpyFu9Xv/mC0WyVla4Tk3Z5zEBGe6k68uFMn3CDv+JfxpB0h1uCLEzCxUxAAWjI8=@vger.kernel.org X-Gm-Message-State: AOJu0YxCZZaZYiwP4EC0dBWB5E18k3tCfQAa+0psiLCv0BYH8ivQTilW QmRNNRe8mKX62JFJmzLyks1cGqlJL1pp7dKqbF9+RYrRWi8piQWdDJXTqcoP3aDzYVo= X-Gm-Gg: AfdE7cmw2B6qppugdBGL+g8U9zqN7pGL09cDgcM0IbrfBtcAIK9pH5K8auyuUYoI3m6 6J7HjmZtOWwC/gGkfmq6iLtHBO43WxH2uQrDOD7e1Vl7lfLabAmryyQy/iYFc1xKf2g2rkUSq8F LMtCaW5rdhOQJLEd1SR75wMdsWAMk2guMayRxAwbkZm5OZsPwpIgVZZaGeyP0X+H27KJnQjzF+X /yGu7ZwRaYWOSQtnJU5ase9P/LieAkpGMcLCKQp4OVvVCA/3TwhtGomRFfa9SK9VysBLUiRsFiS cg2LogUCANEyWF5QS7ZkHumwHcmYZw3P8CcUeMTYwvL4dFzyl6XrIAieZMZGo84qPtScdWhy4wU pgoFAW70U2FTm+BbyRPKK6OzmLW83XvJpTuIvE91ugqn+had5chsxLfMEU6VlL8+JuCQ1l1SO9K Nr9gM= X-Received: by 2002:a05:6a00:2d23:b0:845:bcf0:118 with SMTP id d2e1a72fcca58-847f6f55a19mr7186973b3a.41.1783302950430; Sun, 05 Jul 2026 18:55:50 -0700 (PDT) Received: from lgs.. ([101.36.107.181]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-847f6b96c04sm2832348b3a.22.2026.07.05.18.55.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jul 2026 18:55:49 -0700 (PDT) From: Guangshuo Li To: Chun-Kuang Hu , Philipp Zabel , David Airlie , Simona Vetter , Matthias Brugger , AngeloGioacchino Del Regno , CK Hu , Louis-Alexis Eyraud , dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Guangshuo Li , stable@vger.kernel.org Subject: [PATCH v2] drm/mediatek: mtk_hdmi: Fix DDC adapter double put in v2 Date: Mon, 6 Jul 2026 09:55:07 +0800 Message-ID: <20260706015507.453222-1-lgs201920130244@gmail.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 of_find_i2c_adapter_by_node(): it drops the adapter device reference before the devm action drops it again, and it also puts a module reference that was never taken. Remove the extra i2c_put_adapter() call and drop the now-empty HDMI v2 remove callback. The common devm action releases the adapter device reference. Fixes: 8d0f79886273 ("drm/mediatek: Introduce HDMI/DDC v2 for MT8195/MT8188") Cc: stable@vger.kernel.org Signed-off-by: Guangshuo Li --- v2: - Drop the empty remove callback, as suggested by Johan Hovold. - Mention that i2c_put_adapter() also drops a module reference that was never taken. - Fix the Fixes tag. - Add Cc stable. drivers/gpu/drm/mediatek/mtk_hdmi_v2.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi_v2.c b/drivers/gpu/drm/mediatek/mtk_hdmi_v2.c index 7bbf463056c9..ffe456238a2b 100644 --- a/drivers/gpu/drm/mediatek/mtk_hdmi_v2.c +++ b/drivers/gpu/drm/mediatek/mtk_hdmi_v2.c @@ -1499,13 +1499,6 @@ static int mtk_hdmi_v2_probe(struct platform_device *pdev) return 0; } -static void mtk_hdmi_v2_remove(struct platform_device *pdev) -{ - struct mtk_hdmi *hdmi = platform_get_drvdata(pdev); - - i2c_put_adapter(hdmi->ddc_adpt); -} - static const struct of_device_id mtk_drm_hdmi_v2_of_ids[] = { { .compatible = "mediatek,mt8188-hdmi-tx", .data = &mtk_hdmi_conf_mt8188 }, { .compatible = "mediatek,mt8195-hdmi-tx", .data = &mtk_hdmi_conf_mt8195 }, @@ -1515,7 +1508,6 @@ MODULE_DEVICE_TABLE(of, mtk_drm_hdmi_v2_of_ids); static struct platform_driver mtk_hdmi_v2_driver = { .probe = mtk_hdmi_v2_probe, - .remove = mtk_hdmi_v2_remove, .driver = { .name = "mediatek-drm-hdmi-v2", .of_match_table = mtk_drm_hdmi_v2_of_ids, -- 2.43.0