diff options
author | Pavel Skripkin <paskripkin@gmail.com> | 2021-03-28 21:32:19 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2021-04-09 13:02:20 +0200 |
commit | b7cd0da982e3043f2eec7235ac5530cb18d6af1d (patch) | |
tree | 7b0a2d3c88e83cb21608dfa4d1a9808c896434dc /drivers/media/rc | |
parent | 3ddcea9f7da0d7df25e12c2f2e06082341fed4fb (diff) |
media: dvb-usb: fix memory leak in dvb_usb_adapter_init
syzbot reported memory leak in dvb-usb. The problem was
in invalid error handling in dvb_usb_adapter_init().
for (n = 0; n < d->props.num_adapters; n++) {
....
if ((ret = dvb_usb_adapter_stream_init(adap)) ||
(ret = dvb_usb_adapter_dvb_init(adap, adapter_nrs)) ||
(ret = dvb_usb_adapter_frontend_init(adap))) {
return ret;
}
...
d->num_adapters_initialized++;
...
}
In case of error in dvb_usb_adapter_dvb_init() or
dvb_usb_adapter_dvb_init() d->num_adapters_initialized won't be
incremented, but dvb_usb_adapter_exit() relies on it:
for (n = 0; n < d->num_adapters_initialized; n++)
So, allocated objects won't be freed.
Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
Reported-by: syzbot+3c2be7424cea3b932b0e@syzkaller.appspotmail.com
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/media/rc')
0 files changed, 0 insertions, 0 deletions