summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSasha Levin <sashal@kernel.org>2025-08-22 23:35:54 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-08-28 16:24:36 +0200
commit39d70ce5a252a3a344edc4b04d19c0f5733184a8 (patch)
treea5109c53c8f7d62ecdc14d981f33c5910ffbff7f
parent4ef9526792aef957f75e3b687b99a72422195bd7 (diff)
downloadlinux-39d70ce5a252a3a344edc4b04d19c0f5733184a8.tar.gz
linux-39d70ce5a252a3a344edc4b04d19c0f5733184a8.tar.bz2
linux-39d70ce5a252a3a344edc4b04d19c0f5733184a8.zip
media: qcom: camss: cleanup media device allocated resource on error path
[ Upstream commit 69080ec3d0daba8a894025476c98ab16b5a505a4 ] 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 <vladimir.zapolskiy@linaro.org> Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Signed-off-by: Bryan O'Donoghue <bod@kernel.org> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> [ adapted error label from err_genpd_cleanup to err_cleanup ] Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/media/platform/qcom/camss/camss.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c
index c9265fb26182..3b2dae7c15ac 100644
--- a/drivers/media/platform/qcom/camss/camss.c
+++ b/drivers/media/platform/qcom/camss/camss.c
@@ -1396,7 +1396,7 @@ static int camss_probe(struct platform_device *pdev)
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_cleanup;
+ goto err_media_cleanup;
}
ret = camss_register_entities(camss);
@@ -1438,6 +1438,8 @@ err_register_subdevs:
camss_unregister_entities(camss);
err_register_entities:
v4l2_device_unregister(&camss->v4l2_dev);
+err_media_cleanup:
+ media_device_cleanup(&camss->media_dev);
err_cleanup:
v4l2_async_notifier_cleanup(&camss->notifier);
err_free: