Skip to content

Commit

Permalink
[media] mceusb: plug memory leak on data transmit
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jarod Wilson authored and Mauro Carvalho Chehab committed Jun 11, 2011
1 parent 589e116 commit 0b43fcd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/media/rc/mceusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 0b43fcd

Please sign in to comment.