summaryrefslogtreecommitdiffstats
path: root/drivers/usb/misc/adutux.c
diff options
context:
space:
mode:
authorEric Sesterhenn <snakebyte@gmx.de>2006-10-06 00:09:29 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2006-10-17 23:46:33 +0200
commita65dc301c7448a9a8d24bf1cbfe292541d1fa390 (patch)
treeaccd226dcdd84f0422fd7d933fbfbbebb56ea4fd /drivers/usb/misc/adutux.c
parentUSB: add USB serial mos7720 driver (diff)
downloadlinux-a65dc301c7448a9a8d24bf1cbfe292541d1fa390.tar.xz
linux-a65dc301c7448a9a8d24bf1cbfe292541d1fa390.zip
USB: fix dereference in drivers/usb/misc/adutux.c
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>
Diffstat (limited to 'drivers/usb/misc/adutux.c')
-rw-r--r--drivers/usb/misc/adutux.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/misc/adutux.c b/drivers/usb/misc/adutux.c
index aecd633fe9f6..af2934e016a7 100644
--- a/drivers/usb/misc/adutux.c
+++ b/drivers/usb/misc/adutux.c
@@ -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;
}