OSDN Git Service

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)
commit4babf057c143f3801fd689ba90141f4999b7a916
treec306c6eb351204f6fc33097d2ad3156824885513
parent2362f53dde2c0bec7a4396a8e1c77b28b0fff1f8
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