From 61d3429d6bfd6e954ed4c946ffff4b62c0516366 Mon Sep 17 00:00:00 2001 From: yangkan Date: Thu, 21 Nov 2024 16:14:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9matchfd=E5=A4=B1=E8=B4=A5?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yangkan --- .../composer/v1_0/display_command/display_cmd_utils.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/display/composer/v1_0/display_command/display_cmd_utils.h b/display/composer/v1_0/display_command/display_cmd_utils.h index 37da5ebc..669d3c63 100644 --- a/display/composer/v1_0/display_command/display_cmd_utils.h +++ b/display/composer/v1_0/display_command/display_cmd_utils.h @@ -272,11 +272,15 @@ public: int32_t fdId = -1; DISPLAY_CHK_RETURN(unpacker.ReadInt32(fdId) == false, HDF_FAILURE, HDF_LOGE("%{public}s, read fdId failed", __func__)); - if (fdId < 0 || MatchHdiFd(fdId, hdiFds, fd) == false) { + if (fdId < 0) { + fd = INVALID_FD; + return HDF_SUCCESS; + } + if (MatchHdiFd(fdId, hdiFds, fd) == false) { // If matching failure, the illegal fd is transfered by smq directly, not by binder IPC. HDF_LOGE("%{public}s, matching failure, fd %{public}d, fdId %{public}d, hdiFds.size %{public}zu", __func__, fd, fdId, hdiFds.size()); - fd = INVALID_FD; + return HDF_FAILURE; } return HDF_SUCCESS; } @@ -377,4 +381,4 @@ using CmdUtils = DisplayCmdUtils; } // namespace Display } // namespace HDI } // namespace OHOS -#endif // OHOS_HDI_DISPLAY_V1_0_DISPLAY_CMD_UTILS_H \ No newline at end of file +#endif // OHOS_HDI_DISPLAY_V1_0_DISPLAY_CMD_UTILS_H -- Gitee