mirror of
https://gitee.com/openharmony/drivers_adapter_khdf_linux
synced 2025-02-18 20:18:18 +00:00
fix: framework code rectification
Signed-off-by: YOUR_NAME <guodongqi2@huawei.com>
This commit is contained in:
parent
8146fced90
commit
17891883b3
@ -359,7 +359,7 @@ static int32_t UsbPnpNotifyHdfSendEvent(const struct HdfDeviceObject *deviceObje
|
||||
return HDF_ERR_INVALID_PARAM;
|
||||
}
|
||||
|
||||
data = HdfSBufObtainDefaultSize();
|
||||
data = HdfSbufObtainDefaultSize();
|
||||
if (data == NULL) {
|
||||
HDF_LOGE("%s:%d InitDataBlock failed", __func__, __LINE__);
|
||||
return HDF_FAILURE;
|
||||
@ -403,7 +403,7 @@ OUT:
|
||||
}
|
||||
}
|
||||
ERROR_DEVICE_INFO:
|
||||
HdfSBufRecycle(data);
|
||||
HdfSbufRecycle(data);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -466,7 +466,7 @@ static int32_t TestPnpNotifyHdfSendEvent(const struct HdfDeviceObject *deviceObj
|
||||
return HDF_ERR_INVALID_PARAM;
|
||||
}
|
||||
|
||||
data = HdfSBufObtainDefaultSize();
|
||||
data = HdfSbufObtainDefaultSize();
|
||||
if (data == NULL) {
|
||||
HDF_LOGE("%s InitDataBlock failed", __func__);
|
||||
return HDF_FAILURE;
|
||||
@ -489,11 +489,11 @@ static int32_t TestPnpNotifyHdfSendEvent(const struct HdfDeviceObject *deviceObj
|
||||
goto OUT;
|
||||
}
|
||||
|
||||
HdfSBufRecycle(data);
|
||||
HdfSbufRecycle(data);
|
||||
return ret;
|
||||
|
||||
OUT:
|
||||
HdfSBufRecycle(data);
|
||||
HdfSbufRecycle(data);
|
||||
return HDF_FAILURE;
|
||||
}
|
||||
#endif
|
||||
@ -506,14 +506,14 @@ static int32_t GadgetPnpNotifyHdfSendEvent(const struct HdfDeviceObject *deviceO
|
||||
}
|
||||
|
||||
struct HdfSBuf *data = NULL;
|
||||
data = HdfSBufObtainDefaultSize();
|
||||
data = HdfSbufObtainDefaultSize();
|
||||
if (data == NULL) {
|
||||
HDF_LOGE("%s:%d InitDataBlock failed", __func__, __LINE__);
|
||||
return HDF_FAILURE;
|
||||
}
|
||||
if (!HdfSbufWriteUint8(data, g_gadgetPnpNotifyType)) {
|
||||
HDF_LOGE("%s, UsbEcmRead HdfSbufWriteInt8 error", __func__);
|
||||
HdfSBufRecycle(data);
|
||||
HdfSbufRecycle(data);
|
||||
return HDF_FAILURE;
|
||||
}
|
||||
int32_t ret = HdfDeviceSendEvent(deviceObject, g_gadgetPnpNotifyType, data);
|
||||
@ -521,7 +521,7 @@ static int32_t GadgetPnpNotifyHdfSendEvent(const struct HdfDeviceObject *deviceO
|
||||
HDF_LOGE("%s:%d HdfDeviceSendEvent ret=%d", __func__, __LINE__, ret);
|
||||
}
|
||||
|
||||
HdfSBufRecycle(data);
|
||||
HdfSbufRecycle(data);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user