From: Eric Sesterhenn Date: Thu, 5 Oct 2006 22:09:29 +0000 (+0200) Subject: USB: fix dereference in drivers/usb/misc/adutux.c X-Git-Tag: v2.6.19-rc3~137^2~17 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=a65dc301c7448a9a8d24bf1cbfe292541d1fa390;p=~shefty%2Frdma-dev.git 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 Cc: Randy Dunlap Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/misc/adutux.c b/drivers/usb/misc/adutux.c index aecd633fe9f..af2934e016a 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; }