diff --git a/adapter/uhdf2/manager/src/devmgr_service_stub.c b/adapter/uhdf2/manager/src/devmgr_service_stub.c index 7cb72a92849e5017aec8605091d1ebf83e303592..7eaa093f8a0803a0880d0d1a36f2b9f16dc07d6a 100644 --- a/adapter/uhdf2/manager/src/devmgr_service_stub.c +++ b/adapter/uhdf2/manager/src/devmgr_service_stub.c @@ -197,7 +197,7 @@ int32_t DevmgrServiceStubDispatch(struct HdfRemoteService *stub, int code, struc HDF_LOGE("%{public}s devmgr service stub dispach failed, cmd id is %{public}d, ret = %{public}d", __func__, code, ret); } - return HDF_SUCCESS; + return ret; } // LCOV_EXCL_START diff --git a/framework/core/manager/src/devmgr_service.c b/framework/core/manager/src/devmgr_service.c index fe66b391f4ad6ce66dbf9261e9403c7a8242d275..9beac9167ce48fdf69505d334a3d6b59016519d8 100644 --- a/framework/core/manager/src/devmgr_service.c +++ b/framework/core/manager/src/devmgr_service.c @@ -51,13 +51,13 @@ static bool DevmgrServiceDynamicDevInfoFound( return false; } -#define WAIT_HOST_SLEEP_TIME 1 // ms +#define WAIT_HOST_SLEEP_TIME 2 // ms #define WAIT_HOST_SLEEP_CNT 1000 static int DevmgrServiceStartHostProcess(struct DevHostServiceClnt *hostClnt, bool sync, bool dynamic) { int waitCount = WAIT_HOST_SLEEP_CNT; struct IDriverInstaller *installer = DriverInstallerGetInstance(); - if (installer == NULL || installer->StartDeviceHost == NULL) { + if (installer == NULL || installer->StartDeviceHost == NULL || installer->StopDeviceHost == NULL) { HDF_LOGE("invalid installer"); return HDF_FAILURE; } @@ -79,6 +79,7 @@ static int DevmgrServiceStartHostProcess(struct DevHostServiceClnt *hostClnt, bo if (waitCount <= 0) { HDF_LOGE("wait host(%{public}s, %{public}d) attach timeout", hostClnt->hostName, hostClnt->hostId); + installer->StopDeviceHost(hostClnt->hostId, hostClnt->hostName); hostClnt->hostPid = -1; return HDF_ERR_TIMEOUT; }