lkml.org 
[lkml]   [2006]   [Nov]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] usb: ati remote memleak fix
Date
Hello,

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>

drivers/usb/input/ati_remote.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)

diff -up linux-2.6.19-rc5-mm2-a/drivers/usb/input/ati_remote.c linux-2.6.19-rc5-mm2-b/drivers/usb/input/ati_remote.c
--- linux-2.6.19-rc5-mm2-a/drivers/usb/input/ati_remote.c 2006-11-15 11:24:24.000000000 +0100
+++ linux-2.6.19-rc5-mm2-b/drivers/usb/input/ati_remote.c 2006-11-15 16:33:02.000000000 +0100
@@ -633,13 +633,11 @@ static void ati_remote_free_buffers(stru
usb_free_urb(ati_remote->irq_urb);
usb_free_urb(ati_remote->out_urb);

- if (ati_remote->inbuf)
- usb_buffer_free(ati_remote->udev, DATA_BUFSIZE,
- ati_remote->inbuf, ati_remote->inbuf_dma);
-
- if (ati_remote->outbuf)
- usb_buffer_free(ati_remote->udev, DATA_BUFSIZE,
- ati_remote->inbuf, ati_remote->outbuf_dma);
+ usb_buffer_free(ati_remote->udev, DATA_BUFSIZE,
+ ati_remote->inbuf, ati_remote->inbuf_dma);
+
+ usb_buffer_free(ati_remote->udev, DATA_BUFSIZE,
+ ati_remote->outbuf, ati_remote->outbuf_dma);
}


--
Regards,

Mariusz Kozlowski
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-11-16 16:53    [W:0.021 / U:33.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site