Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f81a18d8 authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Mauro Carvalho Chehab
Browse files

[media] tm6000: Fix resource freeing in 'tm6000_prepare_isoc()'



'usb_free_urb(urb)' is a no-op, because urb is known to be NULL.

It is likelly that releasing resources allocated by
'tm6000_alloc_urb_buffers()' just a few lines above is expected here.

This has been spotted by the following coccinelle script:
@@
expression ret, x, e;
identifier f;
@@

*   if (x == NULL)
    {
     ... when != x = e;
(
*    f(<+...x...+>);
|
*    ret = f(<+...x...+>);
)
     ...
    }

Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent c0746c1a
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -631,7 +631,7 @@ static int tm6000_prepare_isoc(struct tm6000_core *dev)
		urb = usb_alloc_urb(max_packets, GFP_KERNEL);
		urb = usb_alloc_urb(max_packets, GFP_KERNEL);
		if (!urb) {
		if (!urb) {
			tm6000_uninit_isoc(dev);
			tm6000_uninit_isoc(dev);
			usb_free_urb(urb);
			tm6000_free_urb_buffers(dev);
			return -ENOMEM;
			return -ENOMEM;
		}
		}
		dev->isoc_ctl.urb[i] = urb;
		dev->isoc_ctl.urb[i] = urb;