diff options
author | Benoit Parrot <bparrot@ti.com> | 2020-03-06 14:08:39 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2020-03-12 16:25:55 +0100 |
commit | 80264809ea0a3fd2ee8251f31a9eb85d2c3fc77e (patch) | |
tree | 5aa7eb030f2d3a57589d1de310cbcd918cc0cae5 /drivers/media/platform/am437x/am437x-vpfe.c | |
parent | e6599adfad30c340d06574e49a86afa7015c5c60 (diff) |
media: ti-vpe: cal: fix a kernel oops when unloading module
After the switch to use v4l2_async_notifier_add_subdev() and
v4l2_async_notifier_cleanup(), unloading the ti_cal module would cause a
kernel oops.
This was root cause to the fact that v4l2_async_notifier_cleanup() tries
to kfree the asd pointer passed into v4l2_async_notifier_add_subdev().
In our case the asd reference was from a statically allocated struct.
So in effect v4l2_async_notifier_cleanup() was trying to free a pointer
that was not kalloc.
So here we switch to using a kzalloc struct instead of a static one.
To achieve this we re-order some of the calls to prevent asd allocation
from leaking.
Fixes: d079f94c9046 ("media: platform: Switch to v4l2_async_notifier_add_subdev")
Cc: stable@vger.kernel.org
Signed-off-by: Benoit Parrot <bparrot@ti.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/media/platform/am437x/am437x-vpfe.c')
0 files changed, 0 insertions, 0 deletions