From 3ba6733d61caed7c14c9c0233de118354746ce16 Mon Sep 17 00:00:00 2001 From: Michael Lotz Date: Sat, 13 Sep 2008 13:57:40 +0000 Subject: [PATCH] * 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 --- src/system/kernel/disk_device_manager/KDiskDeviceManager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/system/kernel/disk_device_manager/KDiskDeviceManager.cpp b/src/system/kernel/disk_device_manager/KDiskDeviceManager.cpp index dd3e762059..10c0ae6504 100644 --- a/src/system/kernel/disk_device_manager/KDiskDeviceManager.cpp +++ b/src/system/kernel/disk_device_manager/KDiskDeviceManager.cpp @@ -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;