aboutsummaryrefslogtreecommitdiff
path: root/drivers/media/rc/mceusb.c
diff options
context:
space:
mode:
authorJohan Hovold2017-06-01 04:45:59 -0300
committerMauro Carvalho Chehab2017-06-07 09:39:19 -0300
commit2d5a6ce71c72d98d4f7948672842e3e8c265a8b7 (patch)
tree9a77f702399a0a1dea598ddd63b993b992915a7e /drivers/media/rc/mceusb.c
parent4e66a52a2e4c832dfa35a39204d0f7ce717d4a4a (diff)
[media] mceusb: fix memory leaks in error path
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") Cc: stable <stable@vger.kernel.org> # 2.6.36 Cc: Jarod Wilson <jarod@redhat.com> Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/rc/mceusb.c')
-rw-r--r--drivers/media/rc/mceusb.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/media/rc/mceusb.c b/drivers/media/rc/mceusb.c
index 4530237cbb67..04d6cd1818fb 100644
--- a/drivers/media/rc/mceusb.c
+++ b/drivers/media/rc/mceusb.c
@@ -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);