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 36A0E3914ED; Thu, 30 Jul 2026 14:42:32 +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=1785422553; cv=none; b=ZdDd3Z2R2x0mIqAQzW8mrgoCmejxQtmASWMI64uOXkuMBOkNnXAqWDS81UbNlzYBCdFnafgWvm1VCLSBfGyOOF1WIXawbHk2jUjOwPFahsSuAJ7p21MPr+ZbIrHsmvwo0VVXu61028a4+7skr35aW+anzRe30TcgdBb/9tfxiUY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785422553; c=relaxed/simple; bh=uGv43kT7ByO2RBfUjb36fweqR6amvf8G3Ik3AhX0eBA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MNcm2DmeoiqgQh1hoXNgtD4DO5H5gFAvwMcY7Hg6Tke8Lca95jDxQHgEFjRhDKCbKUfwxzmVUz1Wxg2CazDKrpH3yUkwut2qhdRVOCTk8HHoFFlk+dFw2iItF/6rz10lexyggi2Vt+9Ulp97QzTEeBWKmyjfTX7+YxMrFrHtgdE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ae1XcQ8O; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="ae1XcQ8O" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9277F1F000E9; Thu, 30 Jul 2026 14:42:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1785422552; bh=VcsdsY4O55eJmSMqZsdePDDBbDVPTTTQeaygWvD1TzE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=ae1XcQ8OQcmuxNBdlWt/rOBFhcJkjztSBPxU5Epevqrzpr0PZzhHMdfNfKQcexnNK JXvLpjPMY5X7FIK/Os+oC3qFD0dnfnrOvkBOjY7spCpaAQShBrvIuZN2tyPanJFf72 Kz0GsZBY3Tv8FcC8bexwpOp3jUoVpmXswLY1T8dQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Paul Kocialkowski , Ijae Kim , Myeonghun Pak , Nicolas Dufresne , Hans Verkuil Subject: [PATCH 7.1 478/744] media: cedrus: clean up media device on probe failure Date: Thu, 30 Jul 2026 16:12:31 +0200 Message-ID: <20260730141454.453576263@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260730141444.267951807@linuxfoundation.org> References: <20260730141444.267951807@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 7.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Myeonghun Pak commit 2c869b6969f3061cbbdab587f4c0a88bd7fc3cc9 upstream. cedrus_probe() initializes the media device before registering the video device, the media controller, and the media device. If any of those later steps fails, probe returns without calling media_device_cleanup(), so the media device internals initialized by media_device_init() are left behind. Add a media-device cleanup label to the probe unwind path and route video registration failures through it as well. Fixes: 50e761516f2b8c ("media: platform: Add Cedrus VPU decoder driver") Cc: stable@vger.kernel.org Reviewed-by: Paul Kocialkowski Co-developed-by: Ijae Kim Signed-off-by: Ijae Kim Signed-off-by: Myeonghun Pak Signed-off-by: Nicolas Dufresne Signed-off-by: Hans Verkuil Signed-off-by: Greg Kroah-Hartman --- drivers/staging/media/sunxi/cedrus/cedrus.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) --- a/drivers/staging/media/sunxi/cedrus/cedrus.c +++ b/drivers/staging/media/sunxi/cedrus/cedrus.c @@ -507,7 +507,7 @@ static int cedrus_probe(struct platform_ ret = video_register_device(vfd, VFL_TYPE_VIDEO, 0); if (ret) { v4l2_err(&dev->v4l2_dev, "Failed to register video device\n"); - goto err_m2m; + goto err_media; } v4l2_info(&dev->v4l2_dev, @@ -533,7 +533,8 @@ err_m2m_mc: v4l2_m2m_unregister_media_controller(dev->m2m_dev); err_video: video_unregister_device(&dev->vfd); -err_m2m: +err_media: + media_device_cleanup(&dev->mdev); v4l2_m2m_release(dev->m2m_dev); err_v4l2: v4l2_device_unregister(&dev->v4l2_dev);