Skip to contentSkip to conversation

mceusb: fix memory leaks in error path

git:media_tree/master Mauro Carvalho Chehab 1 participant 1 message Jun 7, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

This is an automatic generated email to let you know that the following patch were queued:

Subject: [media] mceusb: fix memory leaks in error path
Author:  Johan Hovold <[email protected]>
Date:    Thu Jun 1 04:45:59 2017 -0300

Fix urb and transfer-buffer leaks in an urb-submission error path which may be hit when a device is disconnected.

Fixes 66e89522aff7 ("V4L/DVB: IR: add mceusb IR receiver driver")
 drivers/media/rc/mceusb.c | 2 ++
 1 file changed, 2 insertions(+)

---

drivers/media/rc/mceusb.c +2 -0
index 4530237cbb67..04d6cd1818fb 100644
@@ -795,6 +795,8 @@ static void mce_request_packet(struct mceusb_dev *ir, unsigned char *data,
 	res = usb_submit_urb(async_urb, GFP_ATOMIC);
 	if (res) {
 		dev_err(dev, "send request FAILED! (res=%d)", res);
+		kfree(async_buf);
+		usb_free_urb(async_urb);
 		return;
 	}
 	dev_dbg(dev, "send request complete (res=%d)", res);