From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 331F332D452 for ; Mon, 5 Jan 2026 10:58:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767610691; cv=none; b=EJveIOY2eqGaVYhjppbi7/ZdDZoDhHDlHezqNscu4m+vswy642m75H0Pq6lbMwA6M/pr/rfiX/h2Nnqls95++vvDhjNDwN460UBzK3R7M3qX22TO1mV4UDId08qLwqmIh1ZmRD8U3dJlJQx0GxNWvgKAWW4lISmw5iG6MsV5PPk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767610691; c=relaxed/simple; bh=kaveEOlISzNdqo8U/K/andAsiBcsPDOMzU2cvlVTPYA=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=CnpMttB74t81pMVV1vxkSV1baJ8gdscyeM9KDjaqeQglpTUUyrjIZqWdSkVIS/oWOttAu5/pRYrFnt3J0VcBbE8K7Gkqb6iavsAZUmQIY5ahT8+TE7E0IkMGS3eQjS0zdFONOi4eU0QuilVTEcUM+SPBnHN7pD8x6TJERC/rieo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=wH4MBeGb; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="wH4MBeGb" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 74809C116D0; Mon, 5 Jan 2026 10:58:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1767610690; bh=kaveEOlISzNdqo8U/K/andAsiBcsPDOMzU2cvlVTPYA=; h=Subject:To:Cc:From:Date:From; b=wH4MBeGbF8cLdra29iO7Xhuvl/964uNmKOJ0gQpADv9OaJTIHuMPyKtEmo9C8uBFL 2UHppvNrrjSdmRHT/lHHleUVvvkKp5N5/5luPKbXD4u+F478TXFEsZEvrz0OeHMv++ RjeDsBTJrWxEg38VEc2uxO5DkUjNTXnPHG/faSpQ= Subject: FAILED: patch "[PATCH] media: platform: mtk-mdp3: fix device leaks at probe" failed to apply to 6.6-stable tree To: johan@kernel.org,angelogioacchino.delregno@collabora.com,hverkuil+cisco@kernel.org,moudy.ho@mediatek.com,nicolas.dufresne@collabora.com Cc: From: Date: Mon, 05 Jan 2026 11:58:07 +0100 Message-ID: <2026010507-repulsion-scribing-ab04@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 6.6-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.6.y git checkout FETCH_HEAD git cherry-pick -x 8f6f3aa21517ef34d50808af0c572e69580dca20 # git commit -s git send-email --to '' --in-reply-to '2026010507-repulsion-scribing-ab04@gregkh' --subject-prefix 'PATCH 6.6.y' HEAD^.. Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 8f6f3aa21517ef34d50808af0c572e69580dca20 Mon Sep 17 00:00:00 2001 From: Johan Hovold Date: Wed, 24 Sep 2025 16:39:19 +0200 Subject: [PATCH] media: platform: mtk-mdp3: fix device leaks at probe Make sure to drop the references taken when looking up the subsys devices during probe on probe failure (e.g. probe deferral) and on driver unbind. Similarly, drop the SCP device reference after retrieving its platform data during probe to avoid leaking it. Note that holding a reference to a device does not prevent its driver data from going away. Fixes: 61890ccaefaf ("media: platform: mtk-mdp3: add MediaTek MDP3 driver") Cc: stable@vger.kernel.org # 6.1 Cc: Moudy Ho Signed-off-by: Johan Hovold Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Nicolas Dufresne Signed-off-by: Hans Verkuil diff --git a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c index 6559d72d5d42..6d26d4aa1eef 100644 --- a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c +++ b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c @@ -157,10 +157,18 @@ void mdp_video_device_release(struct video_device *vdev) kfree(mdp); } +static void mdp_put_device(void *_dev) +{ + struct device *dev = _dev; + + put_device(dev); +} + static int mdp_mm_subsys_deploy(struct mdp_dev *mdp, enum mdp_infra_id id) { struct platform_device *mm_pdev = NULL; struct device **dev; + int ret; int i; if (!mdp) @@ -194,6 +202,11 @@ static int mdp_mm_subsys_deploy(struct mdp_dev *mdp, enum mdp_infra_id id) if (WARN_ON(!mm_pdev)) return -ENODEV; + ret = devm_add_action_or_reset(&mdp->pdev->dev, mdp_put_device, + &mm_pdev->dev); + if (ret) + return ret; + *dev = &mm_pdev->dev; } @@ -279,6 +292,7 @@ static int mdp_probe(struct platform_device *pdev) goto err_destroy_clock_wq; } mdp->scp = platform_get_drvdata(mm_pdev); + put_device(&mm_pdev->dev); } mdp->rproc_handle = scp_get_rproc(mdp->scp);