Commit 76aaf8a9 authored by Dinghao Liu's avatar Dinghao Liu Committed by Mauro Carvalho Chehab

media: tm6000: Fix memleak in tm6000_start_stream

When usb_clear_halt() fails, dvb->bulk_urb->transfer_buffer
and dvb->bulk_urb should be freed just like when
usb_submit_urb() fails.

Fixes: 3169c9b2 ("V4L/DVB (12788): tm6000: Add initial DVB-T support")
Signed-off-by: default avatarDinghao Liu <dinghao.liu@zju.edu.cn>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 15d0c522
...@@ -141,6 +141,10 @@ static int tm6000_start_stream(struct tm6000_core *dev) ...@@ -141,6 +141,10 @@ static int tm6000_start_stream(struct tm6000_core *dev)
if (ret < 0) { if (ret < 0) {
printk(KERN_ERR "tm6000: error %i in %s during pipe reset\n", printk(KERN_ERR "tm6000: error %i in %s during pipe reset\n",
ret, __func__); ret, __func__);
kfree(dvb->bulk_urb->transfer_buffer);
usb_free_urb(dvb->bulk_urb);
dvb->bulk_urb = NULL;
return ret; return ret;
} else } else
printk(KERN_ERR "tm6000: pipe reset\n"); printk(KERN_ERR "tm6000: pipe reset\n");
......
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