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 0EBC32248A5; Tue, 26 Aug 2025 11:22:24 +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=1756207344; cv=none; b=JXRZfZdO1omJiwu/VjA71v48uB7p4VWAgw46mz2FOjRAYFi/yjlJjoQl8wjxCLjXgSixr8x12cEhcJ8asZfXF01vmmxMANyQ5ihF3IHZY0TrdNsL6nlcj7pXElWLDAivMp7XUHkBXrb59R43PbB+k5xQ33t9lmfLiVi9deYQGSM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756207344; c=relaxed/simple; bh=B/Gy2YAFB2URsjcnbKjjMKYncQQrINlX8E7lqNlJoaQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XCE6pYo1Codxjy7F0iYtbjKMCKfq8ZtLO7oqdno7u3/XEjIsGdWmq8V4OIjPTlUHA8MPXC8RRKJRsxFM7Eo6gwC2d1IfVKs5vao2pYbtFuIctLNIuZKRwKSRzCCX2hK1lthCOXoWVIxrHT9TmniVlNRi7lxQwfK7vuIPh20CG8s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=k8XLfO2t; 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="k8XLfO2t" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 94DEAC4CEF1; Tue, 26 Aug 2025 11:22:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1756207343; bh=B/Gy2YAFB2URsjcnbKjjMKYncQQrINlX8E7lqNlJoaQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k8XLfO2txRWBhPn0O+BqV9uy92HK/hXLZpoN1qGb6lo/SZZ/oslObMfsVauq3SR5F WDeg7jEklP5LCAhPiQ6jM1HWInSbd9dBSXF3ByDJUOCvBHH2xzvXa7YjAId2/GuwQD /kd4VUBH+s1Q3/C2uet5KfyhzxoQfbJ4sOwYZKyc= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Vladimir Zapolskiy , Bryan ODonoghue , Bryan ODonoghue , Hans Verkuil Subject: [PATCH 6.16 144/457] media: qcom: camss: cleanup media device allocated resource on error path Date: Tue, 26 Aug 2025 13:07:08 +0200 Message-ID: <20250826110940.933001536@linuxfoundation.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250826110937.289866482@linuxfoundation.org> References: <20250826110937.289866482@linuxfoundation.org> User-Agent: quilt/0.68 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 6.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Vladimir Zapolskiy commit 69080ec3d0daba8a894025476c98ab16b5a505a4 upstream. A call to media_device_init() requires media_device_cleanup() counterpart to complete cleanup and release any allocated resources. This has been done in the driver .remove() right from the beginning, but error paths on .probe() shall also be fixed. Fixes: a1d7c116fcf7 ("media: camms: Add core files") Cc: stable@vger.kernel.org Signed-off-by: Vladimir Zapolskiy Reviewed-by: Bryan O'Donoghue Signed-off-by: Bryan O'Donoghue Signed-off-by: Hans Verkuil Signed-off-by: Greg Kroah-Hartman --- drivers/media/platform/qcom/camss/camss.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/media/platform/qcom/camss/camss.c +++ b/drivers/media/platform/qcom/camss/camss.c @@ -3625,7 +3625,7 @@ static int camss_probe(struct platform_d ret = v4l2_device_register(camss->dev, &camss->v4l2_dev); if (ret < 0) { dev_err(dev, "Failed to register V4L2 device: %d\n", ret); - goto err_genpd_cleanup; + goto err_media_device_cleanup; } v4l2_async_nf_init(&camss->notifier, &camss->v4l2_dev); @@ -3680,6 +3680,8 @@ err_v4l2_device_unregister: v4l2_device_unregister(&camss->v4l2_dev); v4l2_async_nf_cleanup(&camss->notifier); pm_runtime_disable(dev); +err_media_device_cleanup: + media_device_cleanup(&camss->media_dev); err_genpd_cleanup: camss_genpd_cleanup(camss);