Commit c1a16414 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

V4L/DVB (12805): tm6000: Fix a memory leak at tm6000-video

if a transfer buffer allocation fails, the last allocated urb is leaked
(it hasn't been stored in dev->urb[] yet so tm6000_uninit_isoc misses
it). The patch also includes a small typo fix.

Thanks to Florin Malita <fmalita@gmail.com> for pointing this.
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 2b971af2
...@@ -672,6 +672,7 @@ static int tm6000_prepare_isoc(struct tm6000_core *dev, ...@@ -672,6 +672,7 @@ static int tm6000_prepare_isoc(struct tm6000_core *dev,
if (!urb) { if (!urb) {
tm6000_err("cannot alloc isoc_ctl.urb %i\n", i); tm6000_err("cannot alloc isoc_ctl.urb %i\n", i);
tm6000_uninit_isoc(dev); tm6000_uninit_isoc(dev);
usb_free_urb(urb);
return -ENOMEM; return -ENOMEM;
} }
dev->isoc_ctl.urb[i] = urb; dev->isoc_ctl.urb[i] = urb;
......
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