diff options
author | Wei Yongjun <weiyongjun1@huawei.com> | 2016-10-29 21:36:24 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-01-12 05:39:20 -0500 |
commit | fb0a00fb0843136baee7812b7319c2b4db2592aa (patch) | |
tree | 80da1576f168268258c86a18dc0258e60f05e06c /drivers/media/usb | |
parent | 5f6136debf7eefa8e585c2fa52b72403f324fe77 (diff) |
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/usb')
-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 de3ee2547479..8207e6900656 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) | |||
382 | if (buf[0] != 0) | 382 | if (buf[0] != 0) |
383 | deb_info("key: %*ph\n", 5, buf); | 383 | deb_info("key: %*ph\n", 5, buf); |
384 | 384 | ||
385 | ret: | ||
385 | kfree(buf); | 386 | kfree(buf); |
386 | 387 | ||
387 | ret: | ||
388 | return ret; | 388 | return ret; |
389 | } | 389 | } |
390 | EXPORT_SYMBOL(dibusb_rc_query); | 390 | EXPORT_SYMBOL(dibusb_rc_query); |