media: vim2m: replace devm_kzalloc by kzalloc
authorHans Verkuil <hverkuil-cisco@xs4all.nl>
Thu, 21 Feb 2019 13:35:15 +0000 (08:35 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 31 May 2019 13:45:19 +0000 (06:45 -0700)
commit013f1516c0bd4bb86583d2bc20d3fa286da65a20
tree8c6ae49cdec3c27d8758b5f5cd583b2b5450b46d
parent598e10c56433eaf109c87c4c66892597af8d83c6
media: vim2m: replace devm_kzalloc by kzalloc

[ Upstream commit ea6c7e34f3b28e165988aa7391310752969842e8 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/platform/vim2m.c