[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <200703191139.14026.oneukum@suse.de>
Date: Mon, 19 Mar 2007 11:39:13 +0100
From: Oliver Neukum <oneukum@...e.de>
To: linux-usb-devel@...ts.sourceforge.net
Cc: Adrian Bunk <bunk@...sta.de>,
Christian Lucht <lucht@...emercs.com>,
Robert Marquardt <marquardt@...emercs.com>,
Greg Kroah-Hartman <gregkh@...e.de>,
linux-kernel@...r.kernel.org
Subject: [PATCH]Re: [linux-usb-devel] drivers/usb/misc/iowarrior.c: NULL dereference
Am Montag, 19. März 2007 10:25 schrieb Adrian Bunk:
> The Coverity checker spotted the following NULL dereference:
And this fixes an oops upon allocation failures.
Regards
Oliver
Signed-off-by: Oliver Neukum <oneukum@...e.de>
-----
--- linux-2.6.21-rc4/drivers/usb/misc/iowarrior.c.alt 2007-03-19 11:05:37.000000000 +0100
+++ linux-2.6.21-rc4/drivers/usb/misc/iowarrior.c 2007-03-19 11:07:30.000000000 +0100
@@ -417,14 +417,14 @@
if (!int_out_urb) {
retval = -ENOMEM;
dbg("%s Unable to allocate urb ", __func__);
- goto error;
+ goto error_no_urb;
}
buf = usb_buffer_alloc(dev->udev, dev->report_size,
GFP_KERNEL, &int_out_urb->transfer_dma);
if (!buf) {
retval = -ENOMEM;
dbg("%s Unable to allocate buffer ", __func__);
- goto error;
+ goto error_no_buffer;
}
usb_fill_int_urb(int_out_urb, dev->udev,
usb_sndintpipe(dev->udev,
@@ -459,7 +459,9 @@
error:
usb_buffer_free(dev->udev, dev->report_size, buf,
int_out_urb->transfer_dma);
+error_no_buffer:
usb_free_urb(int_out_urb);
+error_no_urb:
atomic_dec(&dev->write_busy);
wake_up_interruptible(&dev->write_wait);
exit:
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists