WSL2-Linux-Kernel/drivers
Yang Yingliang 893a766ac8 media: si470x-i2c: fix possible memory leak in si470x_i2c_probe()
[ Upstream commit ef054e345e ]

n the 'radio->hdl.error' error handling, ctrl handler allocated by
v4l2_ctrl_new_std() does not released, and caused memory leak as
follows:

unreferenced object 0xffff888033d54200 (size 256):
  comm "i2c-si470x-19", pid 909, jiffies 4294914203 (age 8.072s)
  hex dump (first 32 bytes):
    e8 69 11 03 80 88 ff ff 00 46 d5 33 80 88 ff ff  .i.......F.3....
    10 42 d5 33 80 88 ff ff 10 42 d5 33 80 88 ff ff  .B.3.....B.3....
  backtrace:
    [<00000000086bd4ed>] __kmalloc_node+0x1eb/0x360
    [<00000000bdb68871>] kvmalloc_node+0x66/0x120
    [<00000000fac74e4c>] v4l2_ctrl_new+0x7b9/0x1c60 [videodev]
    [<00000000693bf940>] v4l2_ctrl_new_std+0x19b/0x270 [videodev]
    [<00000000c0cb91bc>] si470x_i2c_probe+0x2d3/0x9a0 [radio_si470x_i2c]
    [<0000000056a6f01f>] i2c_device_probe+0x4d8/0xbe0

Fix the error handling path to avoid memory leak.

Reported-by: Hulk Robot <hulkci@huawei.com>
Fixes: 8c081b6f9a ("media: radio: Critical v4l2 registration...")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-01-27 11:03:20 +01:00
..
accessibility
acpi ACPI: CPPC: Add NULL pointer check to cppc_get_perf() 2021-12-01 09:04:38 +01:00
amba ARM: 9120/1: Revert "amba: make use of -1 IRQs warn" 2021-11-06 14:13:31 +01:00
android binder: fix async_free_space accounting for empty parcels 2022-01-05 12:42:39 +01:00
ata libata: if T_LENGTH is zero, dma direction should be DMA_NONE 2021-12-22 09:32:49 +01:00
atm
auxdisplay auxdisplay: charlcd: checking for pointer reference before dereferencing 2022-01-11 15:35:17 +01:00
base devtmpfs regression fix: reconfigure on each mount 2022-01-20 09:13:13 +01:00
bcma Driver core update for 5.15-rc1 2021-09-01 08:44:42 -07:00
block xen/blkfront: harden blkfront against event channel storms 2021-12-22 09:32:51 +01:00
bluetooth Bluetooth: virtio_bt: fix memory leak in virtbt_rx_handle() 2022-01-27 11:03:03 +01:00
bus bus: mhi: core: Fix race while handling SYS_ERR at power up 2022-01-27 11:02:58 +01:00
cdrom
char random: fix crash on multiple early calls to add_bootloader_randomness() 2022-01-16 09:12:45 +01:00
clk clk: bcm-2835: Remove rounding up the dividers 2022-01-27 11:03:03 +01:00
clocksource clocksource/drivers/dw_apb_timer_of: Fix probe failure 2021-12-14 10:57:23 +01:00
comedi comedi: vmk80xx: fix bulk and interrupt message timeouts 2021-11-12 15:05:51 +01:00
connector
counter
cpufreq cpufreq: qcom-hw: Fix probable nested interrupt handling 2022-01-27 11:03:15 +01:00
cpuidle cpuidle: Fix kobject memory leaks in error paths 2021-11-18 19:16:29 +01:00
crypto crypto: qat - fix undetected PFVF timeout in ACK loop 2022-01-27 11:03:17 +01:00
cxl cxl/pmem: Fix reference counting for delayed work 2022-01-27 11:02:58 +01:00
dax libnvdimm for v5.15 2021-09-09 11:39:57 -07:00
dca
devfreq devfreq: use HZ macros 2021-09-08 11:50:26 -07:00
dio
dma dmaengine: st_fdma: fix MODULE_ALIAS 2021-12-22 09:32:41 +01:00
dma-buf dma_fence_array: Fix PENDING_ERROR leak in dma_fence_array_signaled() 2022-01-27 11:02:59 +01:00
edac EDAC/i10nm: Release mdev/mbase when failing to detect HBM 2022-01-11 15:35:15 +01:00
eisa
extcon
firewire FireWire (IEEE 1394) subsystem updates: 2021-09-11 09:47:33 -07:00
firmware firmware: qemu_fw_cfg: fix kobject leak in probe error path 2022-01-20 09:13:15 +01:00
fpga fpga: ice40-spi: Add SPI device ID table 2021-09-27 14:00:41 -07:00
fsi
gnss
gpio gpio: gpio-aspeed-sgpio: Fix wrong hwirq base in irq handler 2022-01-11 15:35:16 +01:00
gpu drm/vboxvideo: fix a NULL vs IS_ERR() check 2022-01-27 11:03:13 +01:00
greybus
hid HID: wacom: Avoid using stale array indicies to read contact count 2022-01-27 11:02:47 +01:00
hsi
hv Drivers: hv: balloon: Use VMBUS_RING_SIZE() wrapper for dm_ring_size 2021-11-25 09:48:46 +01:00
hwmon hwmon: (lm90) Do not report 'busy' status bit as alarm 2021-12-29 12:29:02 +01:00
hwspinlock
hwtracing coresight: trbe: Defer the probe on offline CPUs 2021-11-18 19:16:06 +01:00
i2c i2c: mpc: Avoid out of bounds memory access 2022-01-11 15:35:15 +01:00
i3c
idle
iio iio: trigger: Fix a scheduling whilst atomic issue seen on tsc2046 2022-01-27 11:02:57 +01:00
infiniband RDMA/uverbs: Check for null return of kmalloc_array 2022-01-11 15:35:13 +01:00
input Input: zinitix - make sure the IRQ is allocated before it gets enabled 2022-01-11 15:35:19 +01:00
interconnect interconnect: qcom: sdm660: Add missing a2noc qos clocks 2021-09-13 15:49:55 +03:00
iommu iommu/io-pgtable-arm-v7s: Add error handle for page table allocation failure 2022-01-27 11:02:58 +01:00
ipack ipack: ipoctal: fix module reference leak 2021-09-27 17:38:49 +02:00
irqchip irqchip: nvic: Fix offset for Interrupt Priority Offsets 2021-12-14 10:57:23 +01:00
isdn mISDN: change function names to avoid conflicts 2022-01-11 15:35:18 +01:00
leds
macintosh memblock: introduce saner 'memblock_free_ptr()' interface 2021-09-14 13:23:22 -07:00
mailbox mailbox: mtk-cmdq: Fix local clock ID usage 2021-11-18 19:16:35 +01:00
mcb mcb: fix error handling in mcb_alloc_bus() 2021-09-14 11:22:26 +02:00
md md/raid1: fix missing bitmap update w/o WriteMostly devices 2022-01-11 15:35:15 +01:00
media media: si470x-i2c: fix possible memory leak in si470x_i2c_probe() 2022-01-27 11:03:20 +01:00
memory memory: renesas-rpc-if: Return error in case devm_ioremap_resource() fails 2022-01-27 11:03:11 +01:00
memstick memstick: jmb38x_ms: use appropriate free function in jmb38x_ms_alloc_host() 2021-11-18 19:16:32 +01:00
message
mfd mfd: atmel-flexcom: Use .resume_noirq 2022-01-27 11:03:18 +01:00
misc lkdtm: Fix content of section containing lkdtm_rodata_do_nothing() 2022-01-27 11:02:57 +01:00
mmc mmc: sdhci-pci: Add PCI ID for Intel ADL 2022-01-16 09:12:43 +01:00
most most: fix control-message timeouts 2021-11-18 19:16:08 +01:00
mtd mtd: hyperbus: rpc-if: fix bug in rpcif_hb_remove 2022-01-27 11:03:15 +01:00
mux
net ath11k: Use host CE parameters for CE interrupts configuration 2022-01-27 11:03:17 +01:00
nfc NFC: st21nfca: Fix memory leak in device probe and remove 2022-01-05 12:42:36 +01:00
ntb Bug fixes and clean-ups for Linux v5.15 2021-09-07 13:05:02 -07:00
nubus
nvdimm nvdimm/pmem: cleanup the disk if pmem_release_disk() is yet assigned 2021-11-18 19:17:07 +01:00
nvme nvmet: use IOCB_NOWAIT only if the filesystem supports it 2021-12-01 09:04:52 +01:00
nvmem nvmem: Fix shift-out-of-bound (UBSAN) with byte size cells 2021-10-13 15:09:58 +02:00
of of: unittest: fix EXPECT text for gpio hog errors 2021-11-18 19:16:45 +01:00
opp opp: Fix return in _opp_add_static_v2() 2021-11-18 19:17:00 +01:00
parisc parisc: Move pci_dev_is_behind_card_dino to where it is used 2021-09-09 12:44:31 +02:00
parport parisc architecture updates for kernel 5.15: 2021-09-02 13:16:00 -07:00
pci PCI: Add function 1 DMA alias quirk for Marvell 88SE9125 SATA controller 2022-01-27 11:02:59 +01:00
pcmcia
perf KVM: arm64: Fix PMU probe ordering 2021-09-20 12:43:34 +01:00
phy phy: Sparx5 Eth SerDes: Fix return value check in sparx5_serdes_probe() 2021-11-18 19:16:56 +01:00
pinctrl pinctrl: mediatek: fix global-out-of-bounds issue 2021-12-29 12:29:01 +01:00
platform platform/x86/intel: hid: add quirk to support Surface Go 3 2022-01-16 09:12:45 +01:00
pnp
power power: bq25890: Enable continuous conversion for ADC at charging 2022-01-11 15:35:17 +01:00
powercap powercap: Add Power Limit4 support for Alder Lake SoC 2021-08-25 20:12:16 +02:00
pps
ps3
ptp ptp: ocp: Fix a couple NULL vs IS_ERR() checks 2021-11-25 09:48:40 +01:00
pwm pwm: mtk-disp: Implement atomic API .get_state() 2021-09-02 22:27:46 +02:00
rapidio
ras
regulator regulator: s5m8767: do not use reset value as DVS voltage if GPIO DVS is disabled 2021-11-18 19:15:57 +01:00
remoteproc remoteproc: qcom: pas: Add missing power-domain "mxc" for CDSP 2022-01-20 09:13:14 +01:00
reset reset: renesas: Fix Runtime PM usage 2022-01-11 15:35:16 +01:00
rpmsg
rtc rtc: cmos: take rtc_lock while reading from CMOS 2022-01-27 11:02:52 +01:00
s390 s390/cio: make ccw_device_dma_* more robust 2021-11-18 19:17:18 +01:00
sbus
scsi scsi: libiscsi: Fix UAF in iscsi_conn_get_param()/iscsi_conn_teardown() 2022-01-11 15:35:17 +01:00
sh maple: fix wrong return value of maple_bus_init(). 2021-11-25 09:48:31 +01:00
siox
slimbus Driver core update for 5.15-rc1 2021-09-01 08:44:42 -07:00
soc soc/tegra: fuse: Fix bitwise vs. logical OR warning 2021-12-22 09:32:43 +01:00
soundwire soundwire: bus: stop dereferencing invalid slave pointer 2021-11-18 19:16:54 +01:00
spi spi: hisi-kunpeng: Fix the debugfs directory name incorrect 2022-01-27 11:03:12 +01:00
spmi
ssb
staging media: atomisp: fix uninitialized bug in gmin_get_pmic_id_and_addr() 2022-01-27 11:03:09 +01:00
target scsi: target: Fix alua_tg_pt_gps_count tracking 2021-11-25 09:48:29 +01:00
tc
tee tee: fix put order in teedev_close_context() 2022-01-27 11:03:12 +01:00
thermal thermal: int340x: Fix VCoRefLow MMIO bit offset for TGL 2021-12-14 10:57:14 +01:00
thunderbolt thunderbolt: build kunit tests without structleak plugin 2021-10-06 17:53:49 -06:00
tty tty: serial: atmel: Call dma_async_issue_pending() 2022-01-27 11:03:17 +01:00
uio
usb USB: Fix "slab-out-of-bounds Write" bug in usb_hcd_poll_rh_status 2022-01-16 09:12:43 +01:00
vdpa vdpa: Consider device id larger than 31 2021-12-22 09:32:39 +01:00
vfio vfio/pci: add missing identifier name in argument of function prototype 2021-09-23 14:12:36 -06:00
vhost vdpa: check that offsets are within bounds 2021-12-22 09:32:36 +01:00
video video: vga16fb: Only probe for EGA and VGA 16 color graphic cards 2022-01-20 09:13:14 +01:00
virt nitro_enclaves: Use get_user_pages_unlocked() call to handle mmap assert 2022-01-05 12:42:39 +01:00
virtio virtio/virtio_mem: handle a possible NULL as a memcpy parameter 2022-01-27 11:02:59 +01:00
visorbus
vlynq
vme
w1
watchdog ar7: fix kernel builds for compiler test 2021-11-18 19:17:03 +01:00
xen xen/console: harden hvc_xen against event channel storms 2021-12-22 09:32:52 +01:00
zorro
Kconfig firmware: include drivers/firmware/Kconfig unconditionally 2021-10-07 16:51:26 +02:00
Makefile virtio: always enter drivers/virtio/ 2021-12-22 09:32:39 +01:00