linux-xiaomi-chiron/drivers/media/usb
Alan Stern e469d0b09a media: gspca: Fix memory leak in probe
The gspca driver leaks memory when a probe fails.  gspca_dev_probe2()
calls v4l2_device_register(), which takes a reference to the
underlying device node (in this case, a USB interface).  But the
failure pathway neglects to call v4l2_device_unregister(), the routine
responsible for dropping this reference.  Consequently the memory for
the USB interface and its device never gets released.

This patch adds the missing function call.

Reported-and-tested-by: syzbot+44e64397bd81d5e84cba@syzkaller.appspotmail.com

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
CC: <stable@vger.kernel.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-12-07 15:00:15 +01:00
..
airspy
as102
au0828
b2c2
cpia2
cx231xx
dvb-usb
dvb-usb-v2
em28xx
go7007
gspca
hackrf
hdpvr
msi2500
pvrusb2
pwc
s2255
siano
stk1160
stkwebcam
tm6000
ttusb-budget
ttusb-dec
usbtv
uvc
zr364xx
Kconfig
Makefile