aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/input
diff options
context:
space:
mode:
authorMariusz Kozlowski <m.kozlowski@tuxland.pl>2006-11-25 14:09:38 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-11-25 16:28:34 -0500
commit9dce447a542d8b4bedf13d6a4c4fc6737240372e (patch)
treebba4591cd3564a499481d662ed931c5be1d040c2 /drivers/usb/input
parentcfd3ef2346f924d6c0e82236c20fdb3a8840136a (diff)
[PATCH] usb: ati remote memleak fix
This is a bug. When checking for ati_remote->outbuf we free freeing ati_remote->inbuf so we end up freeing ati_remote->inbuf twice. Also the checks for 'ati_remote->inbuf != NULL' and 'ati_remote->outbuf != NULL' are redundant as usb_buffer_free() does this. Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl> Acked-by: Greg KH <greg@kroah.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/usb/input')
-rw-r--r--drivers/usb/input/ati_remote.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/usb/input/ati_remote.c b/drivers/usb/input/ati_remote.c
index f659f3028ad2..787b847d38cc 100644
--- a/drivers/usb/input/ati_remote.c
+++ b/drivers/usb/input/ati_remote.c
@@ -636,13 +636,11 @@ static void ati_remote_free_buffers(struct ati_remote *ati_remote)
636 if (ati_remote->out_urb) 636 if (ati_remote->out_urb)
637 usb_free_urb(ati_remote->out_urb); 637 usb_free_urb(ati_remote->out_urb);
638 638
639 if (ati_remote->inbuf) 639 usb_buffer_free(ati_remote->udev, DATA_BUFSIZE,
640 usb_buffer_free(ati_remote->udev, DATA_BUFSIZE, 640 ati_remote->inbuf, ati_remote->inbuf_dma);
641 ati_remote->inbuf, ati_remote->inbuf_dma);
642 641
643 if (ati_remote->outbuf) 642 usb_buffer_free(ati_remote->udev, DATA_BUFSIZE,
644 usb_buffer_free(ati_remote->udev, DATA_BUFSIZE, 643 ati_remote->outbuf, ati_remote->outbuf_dma);
645 ati_remote->inbuf, ati_remote->outbuf_dma);
646} 644}
647 645
648static void ati_remote_input_init(struct ati_remote *ati_remote) 646static void ati_remote_input_init(struct ati_remote *ati_remote)