linux/drivers/media/pci/saa7164
Guangshuo Li 28e84c6e2e media: saa7164: fix cleanup on resource allocation failure
saa7164_dev_setup() adds the device to the global saa7164_devlist before
requesting the PCI BAR memory regions.

If get_resources() fails, saa7164_dev_setup() decrements the device count
and returns an error, but leaves the device on saa7164_devlist. The probe
error path then frees the device, leaving a dangling entry on the global
list.

Reuse the existing MMIO mapping error path to remove the device from
saa7164_devlist and decrement the device count before returning.

Also release BAR0 if it was successfully requested but the BAR2 request
fails.

Fixes: 443c1228d5 ("V4L/DVB (12923): SAA7164: Add support for the NXP SAA7164 silicon")
Cc: stable@vger.kernel.org
Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
2026-07-28 15:17:54 +02:00
..
Kconfig
Makefile
saa7164-api.c
saa7164-buffer.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
saa7164-bus.c
saa7164-cards.c
saa7164-cmd.c media: saa7164: Remove unused functions 2025-06-17 10:35:14 +02:00
saa7164-core.c media: saa7164: fix cleanup on resource allocation failure 2026-07-28 15:17:54 +02:00
saa7164-dvb.c media: pci: remove unnecessary (void*) conversions 2023-05-25 16:21:20 +02:00
saa7164-encoder.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
saa7164-fw.c media: saa7164: Fix REV2 firmware filename 2026-03-17 10:50:19 +01:00
saa7164-i2c.c
saa7164-reg.h
saa7164-types.h
saa7164-vbi.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
saa7164.h media: Replace file->private_data access with file_to_v4l2_fh() 2025-08-13 08:33:25 +02:00