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, ¶ms);