diff options
author | Wei Yongjun <weiyongjun1@huawei.com> | 2016-10-29 23:36:24 -0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-11-21 11:40:45 -0200 |
commit | 1f5ecaf985c46889278f51fcb7bc143f60f4eb14 (patch) | |
tree | 7adb3f38a8204b46f7bcd24601609c369948ba65 | |
parent | 33e423c40ccf6eedbb5dc6e687524f9133368601 (diff) | |
download | op-kernel-dev-1f5ecaf985c46889278f51fcb7bc143f60f4eb14.zip op-kernel-dev-1f5ecaf985c46889278f51fcb7bc143f60f4eb14.tar.gz |
[media] dibusb: fix possible memory leak in dibusb_rc_query()
'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>
-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); |