summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cpukit/libblock/src/media.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/cpukit/libblock/src/media.c b/cpukit/libblock/src/media.c
index d1679c8094..3cdb3e933e 100644
--- a/cpukit/libblock/src/media.c
+++ b/cpukit/libblock/src/media.c
@@ -203,7 +203,9 @@ static media_item *get_media_item(
if (
(disk_path == NULL || strcmp(disk_path, item->disk_path) == 0)
- && (mount_path == NULL || strcmp(mount_path, item->mount_path) == 0)
+ && (mount_path == NULL
+ || (item->mount_path != NULL
+ && strcmp(mount_path, item->mount_path) == 0))
) {
return item;
}