Home
last modified time | relevance | path

Searched hist:"4 f4e6644" (Results 1 – 1 of 1) sorted by relevance

/openbmc/linux/drivers/media/usb/gspca/
H A Dgspca.c4f4e6644 Thu Apr 08 05:31:20 CDT 2021 Hans Verkuil <hverkuil-cisco@xs4all.nl> 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>