diff options
author | Dongliang Mu <mudongliangabcd@gmail.com> | 2021-10-19 05:39:52 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2021-11-30 12:06:27 +0100 |
commit | d5e9bddb28057615fed653dcfa25f96896b1ff04 (patch) | |
tree | 92a77f5ceeb410b8a596560a969e5a6e6407722d | |
parent | 0529c0f55da87a338a07f3394f55c4873a937be6 (diff) | |
download | linux-d5e9bddb28057615fed653dcfa25f96896b1ff04.tar.bz2 |
media: driver: s3c_camif: move s3c_camif_unregister_subdev out of camif_unregister_media_entities
In the error handling of s3c_camif_probe, s3c_camif_unregister_subdev
may be executed twice, one is from camif_unregister_media_entities.
Although there is sanity check about the registration status,
it is not good to call s3c_camif_unregister_subdev twice in the error
handling code.
Fix this by moving s3c_camif_unregister_subdev out of
camif_unregister_media_entities, and add a s3c_camif_unregister_subdev
in the s3c_camif_remove.
Signed-off-by: Dongliang Mu <mudongliangabcd@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
-rw-r--r-- | drivers/media/platform/s3c-camif/camif-core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/platform/s3c-camif/camif-core.c b/drivers/media/platform/s3c-camif/camif-core.c index 32892ab359ee..6e8ef86566b7 100644 --- a/drivers/media/platform/s3c-camif/camif-core.c +++ b/drivers/media/platform/s3c-camif/camif-core.c @@ -291,7 +291,6 @@ static void camif_unregister_media_entities(struct camif_dev *camif) { camif_unregister_video_nodes(camif); camif_unregister_sensor(camif); - s3c_camif_unregister_subdev(camif); } /* @@ -520,6 +519,7 @@ static int s3c_camif_remove(struct platform_device *pdev) pm_runtime_disable(&pdev->dev); camif_clk_put(camif); + s3c_camif_unregister_subdev(camif); pdata->gpio_put(); return 0; |