WSL2-Linux-Kernel/drivers/media/platform/ti-vpe
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
..
Makefile media: ti-vpe: cal: Split CAMERARX handling to cal-camerarx.c 2020-07-19 10:40:43 +02:00
cal-camerarx.c media: ti-vpe: cal: allow more than 1 source pads 2021-07-12 14:22:11 +02:00
cal-video.c media: ti-vpe: cal: Fix a NULL pointer dereference in cal_ctx_v4l2_init_formats() 2022-04-08 14:23:16 +02:00
cal.c media: ti-vpe: cal: fix indexing of cal->ctx[] in cal_probe() 2021-07-22 14:01:55 +02:00
cal.h media: ti-vpe: cal: add embedded data support 2021-07-12 14:22:11 +02:00
cal_regs.h media: ti-vpe: cal: add vc and datatype fields to cal_ctx 2021-07-12 13:14:50 +02:00
csc.c media: ti-vpe: csc: remove redundant dev_err call in csc_create() 2021-04-06 16:09:16 +02: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 media: ti-vpe: sc: remove redundant dev_err call in sc_create() 2021-04-06 16:09:31 +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: Simplify bool comparison 2021-03-11 11:59:44 +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: ti-vpe: use pm_runtime_resume_and_get() 2021-05-20 16:02:44 +02:00
vpe_regs.h media: use the BIT() macro 2019-08-26 14:08:50 -03:00