Re: [Patch] Dereference in drivers/usb/misc/adutux.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hi,

> > in two of the error cases, dev is still NULL,
> > and we dereference it. Spotted by coverity (cid#1428, 1429)
> > 
> space after if, for, while, etc.  No space after function names.

updated patch below.

Signed-off-by: Eric Sesterhenn <[email protected]>

--- linux-2.6.19-rc1/drivers/usb/misc/adutux.c.orig	2006-10-05 17:34:45.000000000 +0200
+++ linux-2.6.19-rc1/drivers/usb/misc/adutux.c	2006-10-05 17:34:53.000000000 +0200
@@ -370,7 +370,8 @@ static int adu_release(struct inode *ino
 	retval = adu_release_internal(dev);
 
 exit:
-	up(&dev->sem);
+	if (dev)
+		up(&dev->sem);
 	dbg(2," %s : leave, return value %d", __FUNCTION__, retval);
 	return retval;
 }


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

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux