linux/drivers/media
Lukas Wunner e297ddf296
media: netup_unidvb: Don't leak SPI master in probe error path
If the call to spi_register_master() fails on probe of the NetUP
Universal DVB driver, the spi_master struct is erroneously not freed.

Likewise, if spi_new_device() fails, the spi_controller struct is
not unregistered.  Plug the leaks.

While at it, fix an ordering issue in netup_spi_release() wherein
spi_unregister_master() is called after fiddling with the IRQ control
register.  The correct order is to call spi_unregister_master() *before*
this teardown step because bus accesses may still be ongoing until that
function returns.

Fixes: 52b1eaf4c5 ("[media] netup_unidvb: NetUP Universal DVB-S/S2/T/T2/C PCI-E card driver")
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Cc: <stable@vger.kernel.org> # v4.3+: 5e844cc37a: spi: Introduce device-managed SPI controller allocation
Cc: <stable@vger.kernel.org> # v4.3+
Cc: Kozlov Sergey <serjk@netup.ru>
Link: https://lore.kernel.org/r/c4c24f333fc7840f4a3db24789e6e10dd660bede.1607286887.git.lukas@wunner.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-07 14:18:57 +00:00
..
cec Linux 5.9-rc7 2020-10-04 12:19:12 +02:00
common Linux 5.9-rc7 2020-10-04 12:19:12 +02:00
dvb-core media fixes for v5.9-rc7 2020-09-24 09:05:04 -07:00
dvb-frontends media: dvb-frontends/drxk_hard.c: fix uninitialized variable warning 2020-10-08 14:15:14 +02:00
firewire media: firewire: fix memory leak 2020-09-27 11:29:45 +02:00
i2c media: tvp7002: fix uninitialized variable warning 2020-10-08 14:13:59 +02:00
mc media: mc-device.c: change media_device_request_alloc to match media_ioctl_info 2020-08-29 08:15:23 +02:00
mmc media updates for v5.8-rc1 2020-06-03 20:59:38 -07:00
pci media: netup_unidvb: Don't leak SPI master in probe error path 2020-12-07 14:18:57 +00:00
platform dma-mapping updates for 5.10 2020-10-15 14:43:29 -07:00
radio Linux 5.9-rc4 2020-09-07 16:13:06 +02:00
rc media: rc: gpio-ir-recv: add QoS support for cpuidle system 2020-09-27 11:27:23 +02:00
spi
test-drivers media: vidtv: fix decoding with gstreamer and Vlc 2020-10-01 09:24:54 +02:00
tuners Linux 5.9-rc4 2020-09-07 16:13:06 +02:00
usb media: usbtv: Fix refcounting mixup 2020-10-08 09:08:20 +02:00
v4l2-core media: v4l2-mem2mem: Fix spurious v4l2_m2m_buf_done 2020-10-08 09:08:53 +02:00
Kconfig
Makefile