diff --git a/platform/mipi_dsi/mipi_tx_dev.c b/platform/mipi_dsi/mipi_tx_dev.c index d5ab2a6cd195b795a3d44812be68fcbd60ceef64..0d877007bcf7a755e85bda4fca7096e78b09bd30 100644 --- a/platform/mipi_dsi/mipi_tx_dev.c +++ b/platform/mipi_dsi/mipi_tx_dev.c @@ -336,13 +336,11 @@ static int32_t MipiDsiDevSetCfg(struct MipiDsiCntlr *cntlr, struct MipiCfg *arg) HDF_LOGE("%s: [CopyFromUser] failed.", __func__); return HDF_ERR_IO; } - } else { /* kernel space */ - if (memcpy_s(temp, size, arg, size) != EOK) { - OsalMemFree(temp); - temp = NULL; - HDF_LOGE("%s: [memcpy_s] failed.", __func__); - return HDF_ERR_IO; - } + } else { + OsalMemFree(temp); + temp = NULL; + HDF_LOGE("%s: illegal user space address.", __func__); + return HDF_FAILURE; } ret = MipiDsiCntlrSetCfg(cntlr, temp); @@ -387,13 +385,11 @@ int32_t MipiDsiDevSetCmd(struct MipiDsiCntlr *cntlr, struct DsiCmdDesc *arg) HDF_LOGE("%s: [CopyFromUser] failed.", __func__); return HDF_ERR_IO; } - } else { /* kernel space */ - if (memcpy_s(temp, size, arg, size) != EOK) { - OsalMemFree(temp); - temp = NULL; - HDF_LOGE("%s: [memcpy_s] failed.", __func__); - return HDF_ERR_IO; - } + } else { + OsalMemFree(temp); + temp = NULL; + HDF_LOGE("%s: illegal user space address.", __func__); + return HDF_FAILURE; } ret = MipiDsiCntlrTx(cntlr, temp); @@ -414,11 +410,9 @@ int32_t MipiDsiDevCmdCopyFromUser(GetDsiCmdDescTag *arg, GetDsiCmdDescTag *temp, HDF_LOGE("%s: [CopyFromUser] failed.", __func__); return HDF_ERR_IO; } - } else { /* kernel space */ - if (memcpy_s(temp, *size, arg, *size) != EOK) { - HDF_LOGE("%s: [memcpy_s] failed.", __func__); - return HDF_ERR_IO; - } + } else { + HDF_LOGE("%s: illegal user space address.", __func__); + return HDF_FAILURE; } return HDF_SUCCESS; } @@ -434,11 +428,9 @@ int32_t MipiDsiDevCmdCopyToUser(GetDsiCmdDescTag *arg, GetDsiCmdDescTag *temp, u HDF_LOGE("%s: [CopyToUser] failed.", __func__); return HDF_ERR_IO; } - } else { /* kernel space */ - if (memcpy_s(arg, *size, temp, *size) != EOK) { - HDF_LOGE("%s: [memcpy_s] failed.", __func__); - return HDF_ERR_IO; - } + } else { + HDF_LOGE("%s: illegal user space address.", __func__); + return HDF_FAILURE; } return HDF_SUCCESS; }