linux/drivers/media/platform/rockchip/rga
Dan Carpenter e58430e1d4 media: rockchip/rga: fix error handling in probe
There are a few bugs in this code.  1)  No checks for whether
dma_alloc_attrs() or __get_free_pages() failed.  2)  If
video_register_device() fails it doesn't clean up the dma attrs or the
free pages.  3)  The video_device_release() function frees "vfd" which
leads to a use after free on the next line.  The call to
video_unregister_device() is not required so I have just removed that.

Fixes: f7e7b48e6d ("[media] rockchip/rga: v4l2 m2m support")
Reported-by: Dongliang Mu <mudongliangabcd@gmail.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-07-22 14:01:55 +02:00
..
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
rga-buf.c media: rockchip/rga: use pm_runtime_resume_and_get() 2021-05-19 09:51:42 +02:00
rga-hw.c media: rockchip: rga: Only set output CSC mode for RGB input 2020-07-04 12:44:59 +02:00
rga-hw.h media: rockchip: rga: Introduce color fmt macros and refactor CSC mode logic 2020-07-04 12:44:42 +02:00
rga.c media: rockchip/rga: fix error handling in probe 2021-07-22 14:01:55 +02:00
rga.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 282 2019-06-05 17:36:37 +02:00