From 406b566cfc4be2cc04157ea7bd3c24ea729a4bb5 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Mon, 4 Dec 2017 15:45:49 +0100 Subject: [PATCH] cleanup: drop unneeded check Code already has dereferenced UUID before this point, and its already given we require name & uuid when ading new node (although uuid could be empty string). --- libdm/libdm-deptree.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libdm/libdm-deptree.c b/libdm/libdm-deptree.c index 48323de89..34a15474a 100644 --- a/libdm/libdm-deptree.c +++ b/libdm/libdm-deptree.c @@ -513,14 +513,13 @@ static struct dm_tree_node *_create_dm_tree_node(struct dm_tree *dtree, dev = MKDEV((dev_t)info->major, (dev_t)info->minor); if (!dm_hash_insert_binary(dtree->devs, (const char *) &dev, - sizeof(dev), node)) { + sizeof(dev), node)) { log_error("dtree node hash insertion failed"); dm_pool_free(dtree->mem, node); return NULL; } - if (uuid && *uuid && - !dm_hash_insert(dtree->uuids, uuid, node)) { + if (*uuid && !dm_hash_insert(dtree->uuids, uuid, node)) { log_error("dtree uuid hash insertion failed"); dm_hash_remove_binary(dtree->devs, (const char *) &dev, sizeof(dev));