[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: ff1c123545 ("[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>
This commit is contained in:
Wei Yongjun 2016-10-29 23:36:24 -02:00 committed by Mauro Carvalho Chehab
parent 33e423c40c
commit 1f5ecaf985

View File

@ -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);