linux-stable/drivers/media/usb/gspca
Alan Stern acdd941fca media: gspca: Fix memory leak in probe
commit e469d0b09a upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-12-30 11:54:03 +01:00
..
gl860
m5602 treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 372 2019-06-05 17:37:10 +02:00
stv06xx media: stv06xx: add missing descriptor sanity checks 2020-03-12 17:26:42 +01:00
autogain_functions.c
benq.c
conex.c
cpia1.c
dtcs033.c
etoms.c
finepix.c
gspca.c media: gspca: Fix memory leak in probe 2020-12-30 11:54:03 +01:00
gspca.h
jeilinj.c
jl2005bcd.c media: gspca: remove redundant assignment to variable retval 2020-06-23 13:21:19 +02:00
jpeg.h
Kconfig media: docs: move user-facing docs to the admin guide 2020-04-14 10:34:58 +02:00
kinect.c
konica.c media: gspca: zero usb_buf on error 2019-08-19 12:10:47 -03:00
Makefile
mars.c
mr97310a.c media: Use fallthrough pseudo-keyword 2020-08-29 08:35:27 +02:00
nw80x.c media: Use fallthrough pseudo-keyword 2020-08-29 08:35:27 +02:00
ov519.c media: Use fallthrough pseudo-keyword 2020-08-29 08:35:27 +02:00
ov534.c media: gspca: replace http references with https ones 2020-07-19 07:56:30 +02:00
ov534_9.c media: gspca: zero usb_buf on error 2019-08-19 12:10:47 -03:00
pac207.c
pac7302.c
pac7311.c
pac_common.h
se401.c media: gspca: zero usb_buf on error 2019-08-19 12:10:47 -03:00
se401.h
sn9c20x.c media: Use fallthrough pseudo-keyword 2020-08-29 08:35:27 +02:00
sn9c2028.c media: gspca: remove redundant initialization of variable status 2020-07-19 07:44:37 +02:00
sn9c2028.h
sonixb.c media: gspca: zero usb_buf on error 2019-08-19 12:10:47 -03:00
sonixj.c media: gspca: zero usb_buf on error 2019-08-19 12:10:47 -03:00
spca500.c
spca501.c
spca505.c
spca506.c
spca508.c
spca561.c
spca1528.c media: gspca: zero usb_buf on error 2019-08-19 12:10:47 -03:00
sq905.c media: usb: null check create_singlethread_workqueue 2019-10-10 07:18:10 -03:00
sq905c.c media: gspca: null check create_singlethread_workqueue 2019-10-10 07:17:54 -03:00
sq930x.c media: gspca: zero usb_buf on error 2019-08-19 12:10:47 -03:00
stk014.c
stk1135.c
stk1135.h
stv0680.c media: gspca: remove redundant assignment to variable ret 2019-10-24 18:32:52 -03:00
sunplus.c media: Use fallthrough pseudo-keyword 2020-08-29 08:35:27 +02:00
t613.c
topro.c
touptek.c
tv8532.c
vc032x.c media: gspca: zero usb_buf on error 2019-08-19 12:10:47 -03:00
vicam.c treewide: Remove uninitialized_var() usage 2020-07-16 12:35:15 -07:00
w996Xcf.c media: gspca: zero usb_buf on error 2019-08-19 12:10:47 -03:00
xirlink_cit.c media: Use fallthrough pseudo-keyword 2020-08-29 08:35:27 +02:00
zc3xx-reg.h
zc3xx.c media: Use fallthrough pseudo-keyword 2020-08-29 08:35:27 +02:00