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 37da5ebc311a2e5830e4f311352d104ce5bde092..669d3c6322f988cab8829569e4a637029e490ac4 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