]> git.baikalelectronics.ru Git - kernel.git/commit
media: vimc: allocate vimc_device dynamically
authorDafna Hirschfeld <dafna.hirschfeld@collabora.com>
Wed, 22 Jan 2020 16:01:47 +0000 (17:01 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Thu, 5 Mar 2020 21:42:35 +0000 (22:42 +0100)
commit07fe0fdf3dbb6a8d05145ae759d4de66ceddd8b6
treec306c6eb351204f6fc33097d2ad3156824885513
parentbf5a9aac2c1076a9fb783127addf1c46df04b80e
media: vimc: allocate vimc_device dynamically

In future patch, the release of the device will move
to the release callback of v4l2_device. Therefore the
device will be released only when the last fh will be
closed. Dynamic allocation will then be needed since
when the device is unbounded and then bounded again,
it might be that the probe callback will run before
the release of the last device is finished. In that
case both operations will run on the same memory
concurrently and cause memory corruption.
This patch also removes the pdev field of
vimc_device since it is not needed anymore.

Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/platform/vimc/vimc-common.h
drivers/media/platform/vimc/vimc-core.c