summaryrefslogtreecommitdiffstats
path: root/drivers/media/rc/mceusb.c
diff options
context:
space:
mode:
authorJarod Wilson <jarod@redhat.com>2011-05-24 21:44:54 +0200
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-06-11 14:04:04 +0200
commit0b43fcdff6495958c39e3575848edef4b685ddef (patch)
tree1a10373052489e4e6eff3ef25d960909faa4ef9e /drivers/media/rc/mceusb.c
parent[media] nuvoton-cir: in_use isn't actually in use, remove it (diff)
downloadlinux-0b43fcdff6495958c39e3575848edef4b685ddef.tar.xz
linux-0b43fcdff6495958c39e3575848edef4b685ddef.zip
[media] mceusb: plug memory leak on data transmit
Hans Petter Selasky pointed out to me that we're leaking urbs when mce_async_out is called. Its used both for configuring the hardware and for transmitting IR data. In the tx case, mce_request_packet actually allocates both a urb and the transfer buffer, neither of which was being torn down. Do that in the tx callback. CC: Hans Petter Selasky <hselasky@c2i.net> Signed-off-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/rc/mceusb.c')
-rw-r--r--drivers/media/rc/mceusb.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/media/rc/mceusb.c b/drivers/media/rc/mceusb.c
index 6cf22012079a..06dfe0957b5e 100644
--- a/drivers/media/rc/mceusb.c
+++ b/drivers/media/rc/mceusb.c
@@ -621,6 +621,9 @@ static void mce_async_callback(struct urb *urb, struct pt_regs *regs)
mceusb_dev_printdata(ir, urb->transfer_buffer, 0, len, true);
}
+ /* the transfer buffer and urb were allocated in mce_request_packet */
+ kfree(urb->transfer_buffer);
+ usb_free_urb(urb);
}
/* request incoming or send outgoing usb packet - used to initialize remote */