diff options
Diffstat (limited to 'libdm/libdm-deptree.c')
-rw-r--r-- | libdm/libdm-deptree.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libdm/libdm-deptree.c b/libdm/libdm-deptree.c index 062d32da..0b16efa2 100644 --- a/libdm/libdm-deptree.c +++ b/libdm/libdm-deptree.c @@ -1086,6 +1086,11 @@ struct dm_tree_node *dm_tree_add_new_dev_with_udev_flags(struct dm_tree *dtree, const char *name2; const char *uuid2; + if (!name || !uuid) { + log_error("Cannot add device without name and uuid."); + return NULL; + } + /* Do we need to add node to tree? */ if (!(dnode = dm_tree_find_node_by_uuid(dtree, uuid))) { if (!(name2 = dm_pool_strdup(dtree->mem, name))) { |