kernel_optimize_test/drivers/media
Dongliang Mu 808990afd8 media: hdpvr: initialize dev->worker at hdpvr_register_videodev
[ Upstream commit 07922937e9a580825f9965c46fd15e23ba5754b6 ]

hdpvr_register_videodev is responsible to initialize a worker in
hdpvr_device. However, the worker is only initialized at
hdpvr_start_streaming other than hdpvr_register_videodev.
When hdpvr_probe does not initialize its worker, the hdpvr_disconnect
will encounter one WARN in flush_work.The stack trace is as follows:

 hdpvr_disconnect+0xb8/0xf2 drivers/media/usb/hdpvr/hdpvr-core.c:425
 usb_unbind_interface+0xbf/0x3a0 drivers/usb/core/driver.c:458
 __device_release_driver drivers/base/dd.c:1206 [inline]
 device_release_driver_internal+0x22a/0x230 drivers/base/dd.c:1237
 bus_remove_device+0x108/0x160 drivers/base/bus.c:529
 device_del+0x1fe/0x510 drivers/base/core.c:3592
 usb_disable_device+0xd1/0x1d0 drivers/usb/core/message.c:1419
 usb_disconnect+0x109/0x330 drivers/usb/core/hub.c:2228

Fix this by moving the initialization of dev->worker to the starting of
hdpvr_register_videodev

Reported-by: syzkaller <syzkaller@googlegroups.com>
Signed-off-by: Dongliang Mu <mudongliangabcd@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-04-08 14:40:36 +02:00
..
cec media: cec-pin: fix interrupt en/disable handling 2022-01-27 10:53:43 +01:00
common media: saa7146: hexium_gemini: Fix a NULL pointer dereference in hexium_attach() 2022-01-27 10:54:16 +01:00
dvb-core media: dmxdev: fix UAF when dvb_register_device() fails 2022-01-27 10:53:49 +01:00
dvb-frontends media: dib8000: Fix a memleak in dib8000_init() 2022-01-27 10:53:54 +01:00
firewire media: firewire: firedtv-avc: fix a buffer overflow in avc_ca_pmt() 2021-11-06 14:10:09 +01:00
i2c media: video/hdmi: handle short reads of hdmi info frame. 2022-04-08 14:40:07 +02:00
mc
mmc
pci media: cx88-mpeg: clear interrupt status register before streaming video 2022-04-08 14:40:35 +02:00
platform media: aspeed: Correct value for h-total-pixels 2022-04-08 14:40:05 +02:00
radio media: si470x-i2c: fix possible memory leak in si470x_i2c_probe() 2022-01-27 10:53:51 +01:00
rc media: ir_toy: free before error exiting 2022-04-08 14:40:33 +02:00
spi media: cxd2880-spi: Fix a null pointer dereference on error handling path 2021-11-18 14:04:04 +01:00
test-drivers media: vidtv: Check for null return of vzalloc 2022-04-08 14:40:09 +02:00
tuners media: msi001: fix possible null-ptr-deref in msi001_probe() 2022-01-27 10:53:56 +01:00
usb media: hdpvr: initialize dev->worker at hdpvr_register_videodev 2022-04-08 14:40:36 +02:00
v4l2-core media: v4l2-mem2mem: Apply DST_QUEUE_OFF_BASE on MMAP buffers across ioctls 2022-04-08 14:40:05 +02:00
Kconfig media: correct MEDIA_TEST_SUPPORT help text 2022-01-27 10:54:29 +01:00
Makefile