diff --git a/src/modules/ucmd/type/dm/dm.c b/src/modules/ucmd/type/dm/dm.c index 16dace43..5112634d 100644 --- a/src/modules/ucmd/type/dm/dm.c +++ b/src/modules/ucmd/type/dm/dm.c @@ -170,12 +170,18 @@ static int _dm_ident(struct module *module, struct sid_ucmd_ctx *ucmd_ctx) log_debug(DM_ID, "ident"); snprintf(path, sizeof(path), "%s%s/dm/uuid", SYSTEM_SYSFS_PATH, sid_ucmd_event_get_dev_path(ucmd_ctx)); - sid_util_sysfs_get_value(path, uuid, sizeof(uuid)); + if (sid_util_sysfs_get_value(path, uuid, sizeof(uuid)) < 0) { + log_error(DM_ID, "Failed to get DM uuid."); + return -1; + } sid_ucmd_dev_add_alias(module, ucmd_ctx, "uuid", uuid); sid_ucmd_set_kv(module, ucmd_ctx, KV_NS_DEVMOD, "uuid", uuid, strlen(uuid) + 1, KV_SYNC | KV_SUB_RD); snprintf(path, sizeof(path), "%s%s/dm/name", SYSTEM_SYSFS_PATH, sid_ucmd_event_get_dev_path(ucmd_ctx)); - sid_util_sysfs_get_value(path, name, sizeof(name)); + if (sid_util_sysfs_get_value(path, name, sizeof(name)) < 0) { + log_error(DM_ID, "Failed to get DM name."); + return -1; + } sid_ucmd_dev_add_alias(module, ucmd_ctx, "name", name); sid_ucmd_set_kv(module, ucmd_ctx, KV_NS_DEVMOD, "name", name, strlen(name) + 1, KV_SYNC | KV_SUB_RD);