Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

authored by

Wei Yongjun and committed by
Mauro Carvalho Chehab
1f5ecaf9 33e423c4

+1 -1
+1 -1
drivers/media/usb/dvb-usb/dibusb-common.c
··· 382 382 if (buf[0] != 0) 383 383 deb_info("key: %*ph\n", 5, buf); 384 384 385 + ret: 385 386 kfree(buf); 386 387 387 - ret: 388 388 return ret; 389 389 } 390 390 EXPORT_SYMBOL(dibusb_rc_query);