diff options
author | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2021-04-08 12:31:20 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-05-22 10:38:18 +0200 |
commit | 213c6ba76578a9a7f3a57116394a4d5f5fbd9bd6 (patch) | |
tree | 4c2e7d30d7ac0935612c0c6726308238cc265885 /drivers/media/usb/zr364xx | |
parent | 894a7af3a037ff134b1ba23e946ff5d321c53c30 (diff) |
media: gscpa/stv06xx: fix memory leak
[ Upstream commit 4f4e6644cd876c844cdb3bea2dd7051787d5ae25 ]
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/media/usb/zr364xx')
0 files changed, 0 insertions, 0 deletions