fix: nullptr reference in devhost

Signed-off-by: yuanbo <yuanbo@huawei.com>
This commit is contained in:
yuanbo
2021-12-27 12:33:26 +08:00
parent eb90ef4ffe
commit d27613b498
+1 -2
View File
@@ -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) {