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>
This commit is contained in:
Eric Sesterhenn 2006-10-06 00:09:29 +02:00 коммит произвёл Greg Kroah-Hartman
Родитель 0f64478cbc
Коммит a65dc301c7
1 изменённых файлов: 2 добавлений и 1 удалений

Просмотреть файл

@ -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;
}