mirror of
https://github.com/openharmony/drivers_framework.git
synced 2026-08-27 02:42:28 -04:00
@@ -52,15 +52,15 @@ static int32_t PcieCmdRead(struct PcieCntlr *cntlr, struct HdfSBuf *data, struct
|
||||
ret = PcieCntlrRead(cntlr, pos, buf, len);
|
||||
if (ret != HDF_SUCCESS) {
|
||||
HDF_LOGE("PcieCntlrRead: error, ret is %d", ret);
|
||||
goto EXIST;
|
||||
goto EXIT;
|
||||
}
|
||||
if (!HdfSbufWriteBuffer(reply, buf, len)) {
|
||||
HDF_LOGE("PcieCntlrRead: sbuf write buffer failed");
|
||||
ret = HDF_ERR_IO;
|
||||
goto EXIST;
|
||||
goto EXIT;
|
||||
}
|
||||
ret = HDF_SUCCESS;
|
||||
EXIST:
|
||||
EXIT:
|
||||
OsalMemFree(buf);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -72,24 +72,24 @@ static int32_t PcieUserRead(DevHandle handle, uint32_t pos, uint8_t *data, uint3
|
||||
if (buf == NULL) {
|
||||
HDF_LOGE("PcieUserRead: failed to obtain buf");
|
||||
ret = HDF_ERR_MALLOC_FAIL;
|
||||
goto __EXIT;
|
||||
goto EXIT;
|
||||
}
|
||||
if (!HdfSbufWriteUint32(buf, len)) {
|
||||
HDF_LOGE("PcieUserRead: sbuf write uint32 failed");
|
||||
ret = HDF_ERR_IO;
|
||||
goto __EXIT;
|
||||
goto EXIT;
|
||||
}
|
||||
if (!HdfSbufWriteUint32(buf, pos)) {
|
||||
HDF_LOGE("PcieUserRead: sbuf write uint32 failed");
|
||||
ret = HDF_ERR_IO;
|
||||
goto __EXIT;
|
||||
goto EXIT;
|
||||
}
|
||||
|
||||
reply = HdfSBufObtainDefaultSize();
|
||||
if (reply == NULL) {
|
||||
HDF_LOGE("PcieUserRead: failed to obtain reply");
|
||||
ret = HDF_ERR_MALLOC_FAIL;
|
||||
goto __EXIT;
|
||||
goto EXIT;
|
||||
}
|
||||
|
||||
ret = service->dispatcher->Dispatch(&service->object, PCIE_CMD_READ, buf, reply);
|
||||
@@ -99,7 +99,7 @@ static int32_t PcieUserRead(DevHandle handle, uint32_t pos, uint8_t *data, uint3
|
||||
ret = PcieGetDataFromReply(reply, data, len);
|
||||
}
|
||||
|
||||
__EXIT :
|
||||
EXIT :
|
||||
if (reply != NULL) {
|
||||
HdfSBufRecycle(reply);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user