OpenCloudOS-Kernel/drivers/media/platform/ti-vpe
Benoit Parrot 80264809ea 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: 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>
2020-03-12 16:25:55 +01:00
..
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
cal.c media: ti-vpe: cal: fix a kernel oops when unloading module 2020-03-12 16:25:55 +01:00
cal_regs.h media: ti-vpe: cal: add CSI2 PHY LDO errata support 2019-12-09 11:26:29 +01:00
csc.c media: ti-vpe: csc: fix single vs multiplanar format handling 2019-12-13 09:29:52 +01:00
csc.h media: ti-vpe: vpe: don't rely on colorspace member for conversion 2019-10-10 13:54:22 -03:00
sc.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
sc.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
sc_coeff.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
vpdma.c media: ti-vpe: fix smatch error 2019-11-08 07:27:47 +01:00
vpdma.h media: ti-vpe: vpe: fix a v4l2-compliance failure about invalid sizeimage 2019-10-10 13:49:02 -03:00
vpdma_priv.h media: ti-vpe: vpdma: Use fixed type for address in descriptor 2019-10-10 13:50:36 -03:00
vpe.c media: media/platform: rename VFL_TYPE_GRABBER to _VIDEO 2020-02-24 16:54:14 +01:00
vpe_regs.h media: use the BIT() macro 2019-08-26 14:08:50 -03:00