Fix missing mutex_unlock() in case of opening an already removed device.

Spotted by Mika Lindqvist, thanks!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28957 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Lotz
2009-01-19 17:35:56 +00:00
parent 7f6629a943
commit 236ecca7da
@@ -867,8 +867,10 @@ usb_disk_open(const char *name, uint32 flags, void **cookie)
device_lun *lun = device->luns[i];
if (strncmp(rawName, lun->name, 32) == 0) {
// found the matching device/lun
if (device->removed)
if (device->removed) {
mutex_unlock(&gDeviceListLock);
return B_ERROR;
}
device->open_count++;
*cookie = lun;