WSL2-Linux-Kernel/drivers/media/platform
Zhou Qingyang aa613ac270 media: ti-vpe: cal: Fix a NULL pointer dereference in cal_ctx_v4l2_init_formats()
[ Upstream commit abd7788985 ]

In cal_ctx_v4l2_init_formats(), devm_kzalloc() is assigned to
ctx->active_fmt and there is a dereference of it after that, which could
lead to NULL pointer dereference on failure of devm_kzalloc().

Fix this bug by adding a NULL check of ctx->active_fmt.

This bug was found by a static analyzer.

Builds with 'make allyesconfig' show no new warnings, and our static
analyzer no longer warns about this code.

Fixes: 7168155002 ("media: ti-vpe: cal: Move format handling to cal.c and expose helpers")
Signed-off-by: Zhou Qingyang <zhou1615@umn.edu>
Reviewed-by: Pratyush Yadav <p.yadav@ti.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-04-08 14:23:16 +02:00
..
allegro-dvt media: allegro: ignore interrupt if mailbox is not initialized 2021-11-18 19:16:17 +01:00
am437x media: am437x: fix pm_runtime_get_sync() usage count 2021-05-10 11:36:33 +02:00
atmel media: atmel: atmel-sama7g5-isc: fix ispck leftover 2022-04-08 14:23:13 +02:00
cadence media: v4l2-subdev: add subdev-wide state struct 2021-06-17 10:01:27 +02:00
coda media: coda: Fix missing put_device() call in coda_get_vdoa_data 2022-04-08 14:23:13 +02:00
davinci media: davinci: vpif: fix unbalanced runtime PM enable 2022-04-08 14:23:02 +02:00
exynos-gsc media: exynos-gsc: fix pm_runtime_get_sync() usage count 2021-05-10 11:36:34 +02:00
exynos4-is media: exynos4-is: use DEVICE_ATTR_RW() helper macro 2021-08-04 14:43:50 +02:00
imx-jpeg media: imx-jpeg: Fix the error handling path of 'mxc_jpeg_probe()' 2021-11-18 19:16:28 +01:00
marvell-ccic media: drivers/media/platform/marvell-ccic/mcam-core.c : fix typo 'gettig' > 'getting' 2021-07-12 09:16:37 +02:00
meson/ge2d media: mexon-ge2d: fixup frames size in registers 2022-04-08 14:23:16 +02:00
mtk-jpeg media: mtk-jpeg: use pm_runtime_resume_and_get() 2021-05-19 09:51:42 +02:00
mtk-mdp media: mdk-mdp: fix pm_runtime_get_sync() usage count 2021-05-10 11:36:33 +02:00
mtk-vcodec media: mtk-vcodec: potential dereference of null pointer 2022-04-08 14:23:13 +02:00
mtk-vpu media: mtk-vpu: Fix a resource leak in the error handling path of 'mtk_vpu_probe()' 2021-11-18 19:16:28 +01:00
omap media: videobuf2: Move frame_vector into media subsystem 2021-01-12 14:15:31 +01:00
omap3isp media: omap3isp: Fix missing unlock in isp_subdev_notifier_complete() 2021-08-04 14:43:50 +02:00
qcom media: camss: vfe-170: fix "VFE halt timeout" error 2022-04-08 14:23:12 +02:00
rcar-vin media: rcar-csi2: Optimize the selection PHTW register 2022-01-27 11:05:19 +01:00
rockchip media: rockchip: rkisp1: use device name for debugfs subdir name 2022-01-27 11:04:42 +01:00
s3c-camif media: v4l2-subdev: add subdev-wide state struct 2021-06-17 10:01:27 +02:00
s5p-g2d media: s5p-g2d: Fix a memory leak on ctx->fh.m2m_ctx 2021-06-17 10:21:51 +02:00
s5p-jpeg media: s5p-jpeg: rename JPEG marker constants to prevent build warnings 2021-09-07 07:57:59 +02:00
s5p-mfc media: s5p-mfc: Add checking to s5p_mfc_probe(). 2021-11-18 19:16:12 +01:00
sti media: sti: don't copy past the size 2021-07-12 09:16:31 +02:00
stm32 media: stm32: Potential NULL pointer dereference in dcmi_irq_thread() 2021-11-18 19:16:12 +01:00
sunxi media: sun6i-csi: Allow the video device to be open multiple times 2021-11-18 19:16:28 +01:00
ti-vpe media: ti-vpe: cal: Fix a NULL pointer dereference in cal_ctx_v4l2_init_formats() 2022-04-08 14:23:16 +02:00
vsp1 media: v4l2-subdev: fix some NULL vs IS_ERR() checks 2021-07-22 14:01:54 +02:00
xilinx media: v4l2-subdev: add subdev-wide state struct 2021-06-17 10:01:27 +02:00
Kconfig qcom_scm: hide Kconfig symbol 2021-10-07 16:51:57 +02:00
Makefile media: atmel: atmel-isc: add microchip-xisc driver 2021-06-08 15:46:31 +02:00
aspeed-video.c media: aspeed: Correct value for h-total-pixels 2022-04-08 14:23:14 +02:00
fsl-viu.c media: use getter/setter functions 2021-03-11 11:59:42 +01:00
imx-pxp.c media: imx-pxp: Initialize the spinlock prior to using it 2022-01-27 11:03:19 +01:00
imx-pxp.h
m2m-deinterlace.c media: media/platform: rename VFL_TYPE_GRABBER to _VIDEO 2020-02-24 16:54:14 +01:00
mx2_emmaprp.c media: mx2_emmaprp: Fix memleak in emmaprp_probe 2020-09-26 10:15:39 +02:00
pxa_camera.c media: v4l2-subdev: add subdev-wide state struct 2021-06-17 10:01:27 +02:00
rcar-fcp.c media: rcar-fcp: use pm_runtime_resume_and_get() 2021-05-20 16:02:36 +02:00
rcar_drif.c Revert "media: rcar_drif: fix a memory disclosure" 2021-05-13 17:29:55 +02:00
rcar_fdp1.c media: rcar_fdp1: fix pm_runtime_get_sync() usage count 2021-05-10 11:36:33 +02:00
rcar_jpu.c media: drivers/media/platform/Rcar_jpu.c : fix typo issues 2021-06-02 14:06:51 +02:00
renesas-ceu.c media: v4l2-subdev: add subdev-wide state struct 2021-06-17 10:01:27 +02:00
sh_vou.c media: sh_vou: fix pm_runtime_get_sync() usage count 2021-05-10 11:36:34 +02:00
via-camera.c media: v4l2-subdev: add subdev-wide state struct 2021-06-17 10:01:27 +02:00
via-camera.h
video-mux.c media: video-mux: Skip dangling endpoints 2021-06-28 15:17:42 +02:00