linux-stable/drivers/media/usb/gspca
Hans Verkuil 4f4e6644cd media: gscpa/stv06xx: fix memory leak
For two of the supported sensors the stv06xx driver allocates memory which
is stored in sd->sensor_priv. This memory is freed on a disconnect, but if
the probe() fails, then it isn't freed and so this leaks memory.

Add a new probe_error() op that drivers can use to free any allocated
memory in case there was a probe failure.

Thanks to Pavel Skripkin <paskripkin@gmail.com> for discovering the cause
of the memory leak.

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

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-04-09 13:19:38 +02:00
..
gl860
m5602
stv06xx media: gscpa/stv06xx: fix memory leak 2021-04-09 13:19:38 +02:00
autogain_functions.c
benq.c
conex.c
cpia1.c
dtcs033.c
etoms.c
finepix.c
gspca.c media: gscpa/stv06xx: fix memory leak 2021-04-09 13:19:38 +02:00
gspca.h media: gscpa/stv06xx: fix memory leak 2021-04-09 13:19:38 +02:00
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
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: ov534-ov772x: use semicolons rather than commas to separate statements 2020-11-16 10:31:06 +01:00
ov534_9.c
pac207.c
pac7302.c
pac7311.c
pac_common.h
se401.c
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
sonixj.c
spca500.c
spca501.c
spca505.c
spca506.c
spca508.c
spca561.c
spca1528.c
sq905.c media: gspca/sq905.c: fix uninitialized variable 2021-03-22 11:55:48 +01:00
sq905c.c
sq930x.c
stk014.c
stk1135.c
stk1135.h
stv0680.c
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
vicam.c treewide: Remove uninitialized_var() usage 2020-07-16 12:35:15 -07:00
w996Xcf.c media: media/usb/gspca/w996Xcf.c: /** -> /* 2021-03-22 11:54:09 +01: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