summaryrefslogtreecommitdiff
blob: 6f3dd180f83bb22b67de4fb2abf3815d7301e60d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
--- src/libdevmapper.c
+++ src/libdevmapper.c
@@ -216,6 +216,10 @@
 	r = -EINVAL;
 	if (!dm_task_get_info(dmt, &dmi))
 		goto out;
+	if (!dmi.exists) {
+			r = -ENODEV;
+			goto out;
+	}
 
 	next = dm_get_next_target(dmt, next, &start, &length,
 	                          &target_type, &params);