media: igorplugusb: prevent use after free in probe error

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>
This commit is contained in:
Oliver Neukum 2022-05-12 13:38:47 +01:00 committed by Mauro Carvalho Chehab
parent b3f820b905
commit 522f1d7d95

View 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;