media: vimc: free vimc_cap_device when the last user disappears
authorHans Verkuil <hverkuil-cisco@xs4all.nl>
Thu, 21 Feb 2019 13:47:28 +0000 (08:47 -0500)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Tue, 19 Mar 2019 17:31:37 +0000 (13:31 -0400)
commit3650a23eda89f99b964fbd63a20320fafaa73e33
treedc4b31a232ce48d5e144ca9f6a5c13e37b8e33f2
parentf74267b51cb36321f777807b2e04ca02167ecc08
media: vimc: free vimc_cap_device when the last user disappears

Don't free vimc_cap_device immediately, instead do this
in the video_device release function which is called when the
last user closes the video device. Only then is it safe to
free the memory.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/platform/vimc/vimc-capture.c