Commit fb0a00fb authored by Wei Yongjun's avatar Wei Yongjun Committed by Greg Kroah-Hartman

dibusb: fix possible memory leak in dibusb_rc_query()

commit 1f5ecaf9 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: ff1c1235 ("[media] dibusb: handle error code on RC query")
Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 5f6136de
......@@ -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);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment