From a1806c946483ee30cefc842e320dc7542c2602a9 Mon Sep 17 00:00:00 2001 From: yuanbo Date: Mon, 27 Dec 2021 12:33:26 +0800 Subject: [PATCH] fix: nullptr reference in devhost Signed-off-by: yuanbo --- core/host/src/devhost_service.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/core/host/src/devhost_service.c b/core/host/src/devhost_service.c index ff86228b..c4c051c5 100644 --- a/core/host/src/devhost_service.c +++ b/core/host/src/devhost_service.c @@ -74,8 +74,7 @@ int DevHostServiceAddDevice(struct IDevHostService *inst, const struct HdfDevice device = DevHostServiceQueryOrAddDevice(hostService, DEVICEID(deviceInfo->deviceId)); if (device == NULL || device->super.Attach == NULL) { - ret = HDF_DEV_ERR_NO_DEVICE; - goto error; + return HDF_DEV_ERR_NO_DEVICE; } devNode = device->super.GetDeviceNode(&device->super, deviceInfo->deviceId); if (devNode != NULL) {