Skip to content

Commit

Permalink
USB: fix dereference in drivers/usb/misc/adutux.c
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eric Sesterhenn authored and Greg Kroah-Hartman committed Oct 17, 2006
1 parent 0f64478 commit a65dc30
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/usb/misc/adutux.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit a65dc30

Please sign in to comment.