linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Patch] Pointer dereference in drivers/usb/misc/usblcd
@ 2006-06-26 22:57 Eric Sesterhenn
  0 siblings, 0 replies; only message in thread
From: Eric Sesterhenn @ 2006-06-26 22:57 UTC (permalink / raw)
  To: linux-kernel; +Cc: g.toth

hi,

coverity spotted (id #185) that we still use urb, if the allocation
fails in the error path. This patch fixes this by returning directly.

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>

--- linux-2.6.17-git11/drivers/usb/misc/usblcd.c.orig	2006-06-27 00:52:22.000000000 +0200
+++ linux-2.6.17-git11/drivers/usb/misc/usblcd.c	2006-06-27 00:52:39.000000000 +0200
@@ -200,10 +200,8 @@ static ssize_t lcd_write(struct file *fi
 
 	/* create a urb, and a buffer for it, and copy the data to the urb */
 	urb = usb_alloc_urb(0, GFP_KERNEL);
-	if (!urb) {
-		retval = -ENOMEM;
-		goto error;
-	}
+	if (!urb)
+		return -ENOMEM;
 	
 	buf = usb_buffer_alloc(dev->udev, count, GFP_KERNEL, &urb->transfer_dma);
 	if (!buf) {



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-06-26 22:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-26 22:57 [Patch] Pointer dereference in drivers/usb/misc/usblcd Eric Sesterhenn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).