ret = epc_object_get_string(dm_ev->action_data,
EPC_AD_SERVICE_NAME, &service_path);
- if (!service_path) {
+ if (ret < 0 || !service_path) {
epc_object_append_string(exe_info->action_log, "error",
"Service path has not been provided");
- exe_info->result = -EINVAL;
+ exe_info->result = ret < 0 ? ret : -EINVAL;
return 0;
}
ret = epc_object_get_string(dm_ev->action_data,
EPC_AD_UNIT_NAME, &unit_name);
- if (!unit_name) {
+ if (ret < 0 || !unit_name) {
epc_object_append_string(exe_info->action_log, "error",
"Unit name not specified");
- exe_info->result = -EINVAL;
+ exe_info->result = ret < 0 ? ret : -EINVAL;
return 0;
}
ret = epc_object_get_string(dm_ev->action_data,
EPC_AD_UNIT_ACTION, &unit_action);
- if (!unit_action)
- return finish_action(data, -EINVAL, "Unit action not specified");
+ if (ret < 0 || !unit_action)
+ return finish_action(data, ret < 0 ? ret : -EINVAL, "Unit action not specified");
if (strcmp(unit_action, "StartUnit") &&
strcmp(unit_action, "StopUnit") &&