linux/drivers/media/v4l2-core
Christophe JAILLET caf058833b media: v4l2-core: Fix a potential resource leak in v4l2_fwnode_parse_link()
[ Upstream commit d7b13edd4c ]

If fwnode_graph_get_remote_endpoint() fails, 'fwnode' is known to be NULL,
so fwnode_handle_put() is a no-op.

Release the reference taken from a previous fwnode_graph_get_port_parent()
call instead.

Also handle fwnode_graph_get_port_parent() failures.

In order to fix these issues, add an error handling path to the function
and the needed gotos.

Fixes: ca50c197bd ("[media] v4l: fwnode: Support generic fwnode for parsing standardised properties")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-09-19 12:22:43 +02:00
..
Kconfig
Makefile
tuner-core.c
v4l2-async.c
v4l2-common.c
v4l2-compat-ioctl32.c media: v4l2-compat-ioctl32.c: zero buffer passed to v4l2_compat_get_array_args() 2022-10-05 10:39:40 +02:00
v4l2-ctrls-api.c
v4l2-ctrls-core.c media: v4l2-ctrls: Fix off-by-one error in integer menu control check 2022-12-31 13:14:06 +01:00
v4l2-ctrls-defs.c
v4l2-ctrls-priv.h
v4l2-ctrls-request.c
v4l2-dev.c
v4l2-device.c
v4l2-dv-timings.c media: v4l2-dv-timings.c: fix too strict blanking sanity checks 2022-12-14 11:37:19 +01:00
v4l2-event.c
v4l2-fh.c
v4l2-flash-led-class.c
v4l2-fwnode.c media: v4l2-core: Fix a potential resource leak in v4l2_fwnode_parse_link() 2023-09-19 12:22:43 +02:00
v4l2-h264.c
v4l2-i2c.c
v4l2-ioctl.c
v4l2-jpeg.c media: v4l2-jpeg: ignore the unknown APP14 marker 2023-03-10 09:39:45 +01:00
v4l2-mc.c
v4l2-mem2mem.c media: v4l2-mem2mem: prevent pollerr when last_buffer_dequeued is set 2022-08-17 14:23:23 +02:00
v4l2-spi.c
v4l2-subdev.c
v4l2-trace.c
videobuf-core.c
videobuf-dma-contig.c media: videobuf-dma-contig: use dma_mmap_coherent 2022-12-31 13:14:11 +01:00
videobuf-dma-sg.c
videobuf-vmalloc.c