Skip to content

Commit 423d163

Browse files
Vladimir Zapolskiygregkh
authored andcommitted
media: qcom: camss: cleanup media device allocated resource on error path
commit 69080ec 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: a1d7c11 ("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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 850538d commit 423d163

File tree

1 file changed

+3
-1
lines changed
  • drivers/media/platform/qcom/camss

1 file changed

+3
-1
lines changed

drivers/media/platform/qcom/camss/camss.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3625,7 +3625,7 @@ static int camss_probe(struct platform_device *pdev)
36253625
ret = v4l2_device_register(camss->dev, &camss->v4l2_dev);
36263626
if (ret < 0) {
36273627
dev_err(dev, "Failed to register V4L2 device: %d\n", ret);
3628-
goto err_genpd_cleanup;
3628+
goto err_media_device_cleanup;
36293629
}
36303630

36313631
v4l2_async_nf_init(&camss->notifier, &camss->v4l2_dev);
@@ -3680,6 +3680,8 @@ static int camss_probe(struct platform_device *pdev)
36803680
v4l2_device_unregister(&camss->v4l2_dev);
36813681
v4l2_async_nf_cleanup(&camss->notifier);
36823682
pm_runtime_disable(dev);
3683+
err_media_device_cleanup:
3684+
media_device_cleanup(&camss->media_dev);
36833685
err_genpd_cleanup:
36843686
camss_genpd_cleanup(camss);
36853687

0 commit comments

Comments
 (0)