WSL2-Linux-Kernel/drivers/media/radio
Yang Yingliang ef054e345e media: si470x-i2c: fix possible memory leak in si470x_i2c_probe()
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>
2021-11-30 12:00:53 +01:00
..
si470x media: si470x-i2c: fix possible memory leak in si470x_i2c_probe() 2021-11-30 12:00:53 +01:00
si4713 media: radio: si4713: constify static struct v4l2_ioctl_ops 2021-06-02 13:26:11 +02:00
wl128x media: wl128x: get rid of a potential spectre issue 2020-09-03 11:09:32 +02:00
Kconfig media: docs: move driver-specific info to driver-api 2020-04-14 10:36:18 +02:00
Makefile
dsbr100.c
lm7000.h
radio-aimslab.c
radio-aztech.c
radio-cadet.c
radio-gemtek.c
radio-isa.c isa: Make the remove callback for isa drivers return void 2021-01-26 07:42:27 +01:00
radio-isa.h isa: Make the remove callback for isa drivers return void 2021-01-26 07:42:27 +01:00
radio-keene.c
radio-ma901.c
radio-maxiradio.c media: use getter/setter functions 2021-03-11 11:59:42 +01:00
radio-miropcm20.c
radio-mr800.c
radio-raremono.c
radio-rtrack2.c
radio-sf16fmi.c
radio-sf16fmr2.c isa: Make the remove callback for isa drivers return void 2021-01-26 07:42:27 +01:00
radio-shark.c
radio-shark2.c
radio-si476x.c media: radio-si476x: drop a container_of() abstraction macro 2021-11-29 13:23:14 +01:00
radio-tea5764.c
radio-tea5777.c
radio-tea5777.h
radio-terratec.c
radio-timb.c
radio-trust.c
radio-typhoon.c
radio-wl1273.c media: radio-wl1273: Avoid card name truncation 2021-09-30 10:07:59 +02:00
radio-zoltrix.c
saa7706h.c
tea575x.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
tef6862.c