* CID 312 and CID 313: The device can be NULL in ReadLockPartition().
* CID 314 and CID 315: Same as above just for WriteLockPartition. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27476 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -534,7 +534,7 @@ KDiskDeviceManager::ReadLockPartition(partition_id id)
|
||||
device->Register();
|
||||
}
|
||||
// lock the device
|
||||
if (device->ReadLock()) {
|
||||
if (device && device->ReadLock()) {
|
||||
// final check, if the partition still belongs to the device
|
||||
if (partition->Device() == device)
|
||||
return partition;
|
||||
@@ -563,7 +563,7 @@ KDiskDeviceManager::WriteLockPartition(partition_id id)
|
||||
device->Register();
|
||||
}
|
||||
// lock the device
|
||||
if (device->WriteLock()) {
|
||||
if (device && device->WriteLock()) {
|
||||
// final check, if the partition still belongs to the device
|
||||
if (partition->Device() == device)
|
||||
return partition;
|
||||
|
||||
Reference in New Issue
Block a user