diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2019-02-17 09:12:41 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2019-02-18 12:31:58 -0500 |
commit | 959bba134238452b0a2f5c7d107d7d05b358b41f (patch) | |
tree | 798b29149d1d105d302b1ac7cf178c0e94687d4a /drivers/media | |
parent | dd1df35dd0f6172537271e533fe329a165e56265 (diff) | |
download | linux-stable-959bba134238452b0a2f5c7d107d7d05b358b41f.tar.gz linux-stable-959bba134238452b0a2f5c7d107d7d05b358b41f.tar.bz2 linux-stable-959bba134238452b0a2f5c7d107d7d05b358b41f.zip |
media: vivid: two unregistration fixes
When the media device registration fails, don't call media_device_unregister
since the device was never actually registered.
When removing the module also call media_device_cleanup() to avoid a memory leak.
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/platform/vivid/vivid-core.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/media/platform/vivid/vivid-core.c b/drivers/media/platform/vivid/vivid-core.c index 29e7b14fa704..342e0e6c103b 100644 --- a/drivers/media/platform/vivid/vivid-core.c +++ b/drivers/media/platform/vivid/vivid-core.c @@ -1478,9 +1478,6 @@ static int vivid_create_instance(struct platform_device *pdev, int inst) return 0; unreg_dev: -#ifdef CONFIG_MEDIA_CONTROLLER - media_device_unregister(&dev->mdev); -#endif video_unregister_device(&dev->radio_tx_dev); video_unregister_device(&dev->radio_rx_dev); video_unregister_device(&dev->sdr_cap_dev); @@ -1553,6 +1550,7 @@ static int vivid_remove(struct platform_device *pdev) #ifdef CONFIG_MEDIA_CONTROLLER media_device_unregister(&dev->mdev); + media_device_cleanup(&dev->mdev); #endif if (dev->has_vid_cap) { |