linux/drivers/media/usb
Dongliang Mu c02d2a91a8 media: pvrusb2: fix memory leak in pvr_probe
commit 945a9a8e44 upstream.

The error handling code in pvr2_hdw_create forgets to unregister the
v4l2 device. When pvr2_hdw_create returns back to pvr2_context_create,
it calls pvr2_context_destroy to destroy context, but mp->hdw is NULL,
which leads to that pvr2_hdw_destroy directly returns.

Fix this by adding v4l2_device_unregister to decrease the refcount of
usb interface.

Reported-by: syzbot+77b432d57c4791183ed4@syzkaller.appspotmail.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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2022-09-05 10:31:27 +02:00
..
airspy media: Kconfig: cleanup VIDEO_DEV dependencies 2022-03-18 05:58:35 +01:00
as102 treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 118 2019-05-24 17:39:02 +02:00
au0828 media: Kconfig: cleanup VIDEO_DEV dependencies 2022-03-18 05:58:35 +01:00
b2c2 media: b2c2-flexcop-usb: fix some whitespace coding style 2021-12-14 16:19:04 +01:00
cpia2 media: Kconfig: cleanup VIDEO_DEV dependencies 2022-03-18 05:58:35 +01:00
cx231xx media: cx231xx/cx231xx.h: Remove repeated struct declaration 2021-04-06 16:10:19 +02:00
dvb-usb media: dvb-usb: dib0700_devices: use an enum for the device number 2022-04-18 07:36:44 +02:00
dvb-usb-v2 media: media/*/Kconfig: sort entries 2022-03-18 05:58:35 +01:00
em28xx media: xc2028: rename the driver from tuner-xc2028 2022-03-12 16:59:50 +01:00
go7007 media: usb: go7007: s2250-board: fix leak in probe() 2022-02-22 09:41:12 +01:00
gspca media: gspca: make the read-only array table static const 2022-05-13 11:02:17 +02:00
hackrf media: Kconfig: cleanup VIDEO_DEV dependencies 2022-03-18 05:58:35 +01:00
hdpvr media: hdpvr: fix error value returns in hdpvr_read 2022-08-17 15:14:35 +02:00
msi2500 media: Kconfig: cleanup VIDEO_DEV dependencies 2022-03-18 05:58:35 +01:00
pvrusb2 media: pvrusb2: fix memory leak in pvr_probe 2022-09-05 10:31:27 +02:00
pwc media: Kconfig: cleanup VIDEO_DEV dependencies 2022-03-18 05:58:35 +01:00
s2255 media: Kconfig: cleanup VIDEO_DEV dependencies 2022-03-18 05:58:35 +01:00
siano media: siano: remove duplicate USB device IDs 2021-12-07 11:29:58 +01:00
stk1160 media: stk1160: use dma_alloc_noncontiguous API 2022-03-07 11:01:22 +01:00
stkwebcam media: stkwebcam: move stk_camera_read_reg() scratch buffer to struct stk_camera 2022-05-13 11:02:20 +02:00
tm6000 media: remove third argument of usb_maxpacket() 2022-04-23 10:33:53 +02:00
ttusb-budget media: dvb-ttusb-budget: cleanup printk logic 2020-09-03 11:15:47 +02:00
ttusb-dec media: ttusb-dec: avoid release of non-acquired mutex 2021-09-30 10:07:40 +02:00
usbtv media: Kconfig: cleanup VIDEO_DEV dependencies 2022-03-18 05:58:35 +01:00
uvc media: uvcvideo: Add UVC_GUID_FORMAT_H265 2022-05-08 07:10:51 +02:00
zr364xx media: Kconfig: cleanup VIDEO_DEV dependencies 2022-03-18 05:58:35 +01:00
Kconfig media: media/*/Kconfig: sort entries 2022-03-18 05:58:35 +01:00
Makefile media: Makefiles: sort entries where it fits 2022-03-14 09:42:59 +01:00