Message ID | 20250513142353.2572563-2-vladimir.zapolskiy@linaro.org |
---|---|
State | New |
Headers | show |
Series | media: qcom: camss: a number of cleanups and fixes | expand |
On 13/05/2025 15:23, Vladimir Zapolskiy wrote: > 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") > Signed-off-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org> > --- > drivers/media/platform/qcom/camss/camss.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c > index 06f42875702f..f76773dbd296 100644 > --- 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_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_genpd_cleanup; > + goto err_media_device_cleanup; > } > > v4l2_async_nf_init(&camss->notifier, &camss->v4l2_dev); > @@ -3680,6 +3680,8 @@ static int camss_probe(struct platform_device *pdev) > 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); > > -- > 2.45.2 > > Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c index 06f42875702f..f76773dbd296 100644 --- 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_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_genpd_cleanup; + goto err_media_device_cleanup; } v4l2_async_nf_init(&camss->notifier, &camss->v4l2_dev); @@ -3680,6 +3680,8 @@ static int camss_probe(struct platform_device *pdev) 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);
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") Signed-off-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org> --- drivers/media/platform/qcom/camss/camss.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)