]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
media: vimc: fix memory leak
authorHans Verkuil <hverkuil@xs4all.nl>
Sun, 17 Feb 2019 14:38:19 +0000 (09:38 -0500)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Mon, 18 Feb 2019 17:32:21 +0000 (12:32 -0500)
media_device_cleanup() wasn't called, which caused a small
memory leak.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/platform/vimc/vimc-core.c

index c2fdf3ea67ed102516fff66f9086a20a773b87d6..0fbb7914098f67dca1e01481ebeec5e75284a3f7 100644 (file)
@@ -220,6 +220,7 @@ static int vimc_comp_bind(struct device *master)
 
 err_mdev_unregister:
        media_device_unregister(&vimc->mdev);
+       media_device_cleanup(&vimc->mdev);
 err_comp_unbind_all:
        component_unbind_all(master, NULL);
 err_v4l2_unregister:
@@ -236,6 +237,7 @@ static void vimc_comp_unbind(struct device *master)
        dev_dbg(master, "unbind");
 
        media_device_unregister(&vimc->mdev);
+       media_device_cleanup(&vimc->mdev);
        component_unbind_all(master, NULL);
        v4l2_device_unregister(&vimc->v4l2_dev);
 }