From: Wei Yongjun Date: Sun, 30 Oct 2016 01:36:24 +0000 (-0200) Subject: [media] dibusb: fix possible memory leak in dibusb_rc_query() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1f5ecaf985c46889278f51fcb7bc143f60f4eb14;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git [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 Signed-off-by: Mauro Carvalho Chehab --- 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) if (buf[0] != 0) deb_info("key: %*ph\n", 5, buf); +ret: kfree(buf); -ret: return ret; } EXPORT_SYMBOL(dibusb_rc_query);