diff options
author | Pratyush Yadav <[email protected]> | 2023-10-09 18:39:30 +0530 |
---|---|---|
committer | Hans Verkuil <[email protected]> | 2023-10-12 09:22:28 +0200 |
commit | aee5b415c95aa913aa9222bbe13c817c7e67ec85 (patch) | |
tree | 26756924183221d6ed54846f71e0206800a722ad | |
parent | b2701715301a49b53d05c7d43f3fedc3b8743bfc (diff) |
media: cadence: csi2rx: Cleanup media entity properly
Call media_entity_cleanup() in probe error path and remove to make sure
the media entity is cleaned up properly.
Suggested-by: Laurent Pinchart <[email protected]>
Signed-off-by: Pratyush Yadav <[email protected]>
Tested-by: Julien Massot <[email protected]>
Reviewed-by: Laurent Pinchart <[email protected]>
Reviewed-by: Tomi Valkeinen <[email protected]>
Reviewed-by: Maxime Ripard <[email protected]>
Signed-off-by: Jai Luthra <[email protected]>
Signed-off-by: Sakari Ailus <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
-rw-r--r-- | drivers/media/platform/cadence/cdns-csi2rx.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/media/platform/cadence/cdns-csi2rx.c b/drivers/media/platform/cadence/cdns-csi2rx.c index 64e472ca3594..399b2f800dc4 100644 --- a/drivers/media/platform/cadence/cdns-csi2rx.c +++ b/drivers/media/platform/cadence/cdns-csi2rx.c @@ -547,6 +547,7 @@ static int csi2rx_probe(struct platform_device *pdev) err_cleanup: v4l2_async_nf_unregister(&csi2rx->notifier); v4l2_async_nf_cleanup(&csi2rx->notifier); + media_entity_cleanup(&csi2rx->subdev.entity); err_free_priv: kfree(csi2rx); return ret; @@ -559,6 +560,7 @@ static void csi2rx_remove(struct platform_device *pdev) v4l2_async_nf_unregister(&csi2rx->notifier); v4l2_async_nf_cleanup(&csi2rx->notifier); v4l2_async_unregister_subdev(&csi2rx->subdev); + media_entity_cleanup(&csi2rx->subdev.entity); kfree(csi2rx); } |