OCProvisionDev_t *clone;
+ RETV_IF(NULL == src, NULL);
+
clone = PMCloneOCProvisionDev(src);
if (NULL == clone) {
ERR("PMCloneOCProvisionDev() Fail");
{
FN_CALL;
OCProvisionDev_t *current;
- OCProvisionDev_t *dev_list = devices->dev_list;
+ OCProvisionDev_t *dev_list;
RETV_IF(false == ic_utils_check_ocf_feature(), IOTCON_ERROR_NOT_SUPPORTED);
+ RETV_IF(NULL == devices, IOTCON_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == device, IOTCON_ERROR_INVALID_PARAMETER);
+
+ dev_list = devices->dev_list;
current = icl_provisioning_devices_get_devices(devices);
for (; current; current = current->next) {
return IOTCON_ERROR_OUT_OF_MEMORY;
}
- while (dev_list->next)
- dev_list = dev_list->next;
-
- dev_list->next = current;
+ if (NULL == dev_list)
+ dev_list = current;
+ else {
+ while (dev_list->next)
+ dev_list = dev_list->next;
+ dev_list->next = current;
+ }
return IOTCON_ERROR_NONE;
}
{
FN_CALL;
+ RETV_IF(NULL == owned_devices && NULL == unowned_devices,
+ IOTCON_ERROR_INVALID_PARAMETER);
+
if (owned_devices)
*owned_devices = icl_owned_devices;