]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
V4L/DVB (12805): tm6000: Fix a memory leak at tm6000-video
authorMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 15 Oct 2007 18:43:50 +0000 (15:43 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 18 May 2010 03:39:50 +0000 (00:39 -0300)
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: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/staging/tm6000/tm6000-video.c

index 58fcf6ae60695d03eb78d1a4e1fd649dab730892..cdaf44806e3e72a7565f7be69af600a299be4588 100644 (file)
@@ -672,6 +672,7 @@ static int tm6000_prepare_isoc(struct tm6000_core *dev,
                if (!urb) {
                        tm6000_err("cannot alloc isoc_ctl.urb %i\n", i);
                        tm6000_uninit_isoc(dev);
+                       usb_free_urb(urb);
                        return -ENOMEM;
                }
                dev->isoc_ctl.urb[i] = urb;