summaryrefslogtreecommitdiffstats
path: root/drivers/usb/misc
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 14:46:33 -0700
commita65dc301c7448a9a8d24bf1cbfe292541d1fa390 (patch)
treeaccd226dcdd84f0422fd7d933fbfbbebb56ea4fd /drivers/usb/misc
parent0f64478cbc7a008fe7b7e9ae79a73d8a6904ead8 (diff)
downloadop-kernel-dev-a65dc301c7448a9a8d24bf1cbfe292541d1fa390.zip
op-kernel-dev-a65dc301c7448a9a8d24bf1cbfe292541d1fa390.tar.gz
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')
-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 aecd633..af2934e 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;
}
OpenPOWER on IntegriCloud