diff options
author | Wei Yongjun <weiyongjun1@huawei.com> | 2016-10-30 01:36:24 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-01-12 10:39:20 (GMT) |
commit | fb0a00fb0843136baee7812b7319c2b4db2592aa (patch) | |
tree | 80da1576f168268258c86a18dc0258e60f05e06c /drivers/media | |
parent | 5f6136debf7eefa8e585c2fa52b72403f324fe77 (diff) | |
download | linux-fb0a00fb0843136baee7812b7319c2b4db2592aa.tar.xz |
dibusb: fix possible memory leak in dibusb_rc_query()
commit 1f5ecaf985c46889278f51fcb7bc143f60f4eb14 upstream.
'buf' is malloced in dibusb_rc_query() and should be freed before
leaving from the error handling cases, otherwise it will cause
memory leak.
Fixes: ff1c123545d7 ("[media] dibusb: handle error code on RC query")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/usb/dvb-usb/dibusb-common.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/usb/dvb-usb/dibusb-common.c b/drivers/media/usb/dvb-usb/dibusb-common.c index de3ee25..8207e69 100644 --- a/drivers/media/usb/dvb-usb/dibusb-common.c +++ b/drivers/media/usb/dvb-usb/dibusb-common.c @@ -382,9 +382,9 @@ int dibusb_rc_query(struct dvb_usb_device *d, u32 *event, int *state) if (buf[0] != 0) deb_info("key: %*ph\n", 5, buf); +ret: kfree(buf); -ret: return ret; } EXPORT_SYMBOL(dibusb_rc_query); |