]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
USB: fix dereference in drivers/usb/misc/adutux.c
authorEric Sesterhenn <snakebyte@gmx.de>
Thu, 5 Oct 2006 22:09:29 +0000 (00:09 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 17 Oct 2006 21:46:33 +0000 (14:46 -0700)
in two of the error cases, dev is still NULL,
and we dereference it. Spotted by coverity (cid#1428, 1429)

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
Cc: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/misc/adutux.c

index aecd633fe9f6966f20a9879f8b455675ffbc7d27..af2934e016a7e76313816ba480e81a060de5a4b4 100644 (file)
@@ -370,7 +370,8 @@ static int adu_release(struct inode *inode, struct file *file)
        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;
 }