media: ir_toy: free before error exiting

[ Upstream commit 52cdb01303 ]

Fix leak in error path.

Signed-off-by: Peiwei Hu <jlu.hpw@foxmail.com>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Peiwei Hu 2021-12-29 02:15:18 +01:00 committed by Greg Kroah-Hartman
parent cec06ce393
commit 93ef3fdf3b

View file

@ -458,7 +458,7 @@ static int irtoy_probe(struct usb_interface *intf,
err = usb_submit_urb(irtoy->urb_in, GFP_KERNEL); err = usb_submit_urb(irtoy->urb_in, GFP_KERNEL);
if (err != 0) { if (err != 0) {
dev_err(irtoy->dev, "fail to submit in urb: %d\n", err); dev_err(irtoy->dev, "fail to submit in urb: %d\n", err);
return err; goto free_rcdev;
} }
err = irtoy_setup(irtoy); err = irtoy_setup(irtoy);