media: igorplugusb: prevent use after free in probe error
authorOliver Neukum <oneukum@suse.com>
Thu, 12 May 2022 12:38:47 +0000 (13:38 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Mon, 20 Jun 2022 09:30:33 +0000 (10:30 +0100)
The timer uses the URB. Free it only after the timer
has been stopped.

Signed-off-by: Oliver Neukum <oneukum@suse.com>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/rc/igorplugusb.c

index b46362d..1afba95 100644 (file)
@@ -223,9 +223,9 @@ static int igorplugusb_probe(struct usb_interface *intf,
 
        return 0;
 fail:
-       rc_free_device(ir->rc);
-       usb_free_urb(ir->urb);
        del_timer(&ir->timer);
+       usb_free_urb(ir->urb);
+       rc_free_device(ir->rc);
        kfree(ir->buf_in);
 
        return ret;