media: vim2m: replace devm_kzalloc by kzalloc
authorHans Verkuil <hverkuil-cisco@xs4all.nl>
Thu, 21 Feb 2019 13:35:15 +0000 (08:35 -0500)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Tue, 19 Mar 2019 17:23:19 +0000 (13:23 -0400)
commitea6c7e34f3b28e165988aa7391310752969842e8
treee0e6bcb7ca606603454ae9365ce041c4b46e6e1b
parent57ac534828798affcf13b6f9122dfac7bf135dd0
media: vim2m: replace devm_kzalloc by kzalloc

It is not possible to use devm_kzalloc since that memory is
freed immediately when the device instance is unbound.

Various objects like the video device may still be in use
since someone has the device node open, and when that is closed
it expects the memory to be around.

So use kzalloc and release it at the appropriate time.

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/vim2m.c