1
0
Fork 0
alistair23-linux/drivers/media
Benoit Parrot 15ae94fe22 media: ti-vpe: cal: fix a kernel oops when unloading module
commit 80264809ea upstream.

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: d079f94c90 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-17 10:50:08 +02:00
..
cec media: cec: check 'transmit_in_progress', not 'transmitting' 2020-01-09 10:19:56 +01:00
common media: v4l2-tpg: add support for new pixelformats 2019-07-30 12:16:45 -04:00
dvb-core media: dvb-core: fix a memory leak bug 2019-08-21 18:39:54 -03:00
dvb-frontends media: don't do a 31 bit shift on a signed int 2019-08-26 14:11:10 -03:00
firewire media: firewire: Make structure fdtv_ca constant 2019-08-21 18:39:55 -03:00
i2c media: i2c: ov5695: Fix power on and off sequences 2020-04-17 10:50:04 +02:00
mc media: mc-entity.c: use & to check pad flags, not == 2020-03-12 13:00:21 +01:00
mmc treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
pci media: cx23885: Add support for AVerMedia CE310B 2020-02-24 08:36:35 +01:00
platform media: ti-vpe: cal: fix a kernel oops when unloading module 2020-04-17 10:50:08 +02:00
radio media: si470x-i2c: add missed operations in remove 2019-12-31 16:45:13 +01:00
rc media: rc: add keymap for Videostrong KII Pro 2020-04-17 10:49:59 +02:00
spi media: Clarify how menus are hidden by SUBDRV_AUTOSELECT 2019-08-19 12:00:29 -03:00
tuners media: Clarify how menus are hidden by SUBDRV_AUTOSELECT 2019-08-19 12:00:29 -03:00
usb media: xirlink_cit: add missing descriptor sanity checks 2020-04-01 11:02:18 +02:00
v4l2-core media: v4l2-core: fix a use-after-free bug of sd->devnode 2020-04-01 11:02:18 +02:00
Kconfig media: Clarify how menus are hidden by SUBDRV_AUTOSELECT 2019-08-19 12:00:29 -03:00
Makefile media: move drivers/media/media-* to drivers/media/mc/mc-* 2019-05-28 12:15:46 -04:00