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

Configure Feed

Select the types of activity you want to include in your feed.

media: mceusb: drop redundant device reference

Driver core holds a reference to the USB interface and its parent USB
device while the interface is bound to a driver and there is no need to
take additional references unless the structures are needed after
disconnect.

Drop the redundant device reference to reduce cargo culting, make it
easier to spot drivers where an extra reference is needed, and reduce
the risk of memory leaks when drivers fail to release it.

Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>

authored by

Johan Hovold and committed by
Hans Verkuil
1f03894b 88796a18

+1 -3
+1 -3
drivers/media/rc/mceusb.c
··· 1729 1729 goto urb_in_alloc_fail; 1730 1730 1731 1731 ir->usbintf = intf; 1732 - ir->usbdev = usb_get_dev(dev); 1732 + ir->usbdev = dev; 1733 1733 ir->dev = &intf->dev; 1734 1734 ir->len_in = maxp; 1735 1735 ir->flags.microsoft_gen1 = is_microsoft_gen1; ··· 1817 1817 /* Error-handling path */ 1818 1818 rc_dev_fail: 1819 1819 cancel_work_sync(&ir->kevent); 1820 - usb_put_dev(ir->usbdev); 1821 1820 usb_kill_urb(ir->urb_in); 1822 1821 usb_free_urb(ir->urb_in); 1823 1822 urb_in_alloc_fail: ··· 1848 1849 usb_kill_urb(ir->urb_in); 1849 1850 usb_free_urb(ir->urb_in); 1850 1851 usb_free_coherent(dev, ir->len_in, ir->buf_in, ir->dma_in); 1851 - usb_put_dev(dev); 1852 1852 rc_free_device(ir->rc); 1853 1853 1854 1854 kfree(ir);