From 45c3ce0d485f8a4c9781005da043dcdb36144b5f Mon Sep 17 00:00:00 2001 From: Cai_Jianxing Date: Fri, 22 Sep 2023 11:41:39 +0800 Subject: [PATCH] [VP] fix coverity issue6 fix coverity issue 6 --- .../hal/feature_manager/vp_obj_factories.cpp | 6 ++++- .../common/ddi/media_libva_common_next.cpp | 2 +- .../common/os/private/mos_os_specific.cpp | 22 ------------------- 3 files changed, 6 insertions(+), 24 deletions(-) diff --git a/media_softlet/agnostic/common/vp/hal/feature_manager/vp_obj_factories.cpp b/media_softlet/agnostic/common/vp/hal/feature_manager/vp_obj_factories.cpp index 0649dcea81d..cf679b0103c 100644 --- a/media_softlet/agnostic/common/vp/hal/feature_manager/vp_obj_factories.cpp +++ b/media_softlet/agnostic/common/vp/hal/feature_manager/vp_obj_factories.cpp @@ -238,7 +238,11 @@ MOS_STATUS SwFilterPipeFactory::Create(PVP_PIPELINE_PARAMS params, std::vectorDestroy(tempParams); + VP_PUBLIC_CHK_STATUS_RETURN(MOS_STATUS_NULL_POINTER); + } FeatureRule featureRule; MOS_STATUS status = pipe->Initialize(*tempParams, featureRule); diff --git a/media_softlet/linux/common/ddi/media_libva_common_next.cpp b/media_softlet/linux/common/ddi/media_libva_common_next.cpp index 7ae5b8569fa..93e5e5768f9 100644 --- a/media_softlet/linux/common/ddi/media_libva_common_next.cpp +++ b/media_softlet/linux/common/ddi/media_libva_common_next.cpp @@ -452,7 +452,7 @@ int32_t MediaLibvaCommonNext::GetGpuPriority( if (updateSessionPriority) { *updatePriority = true; - if (priorityValue >= 0 && priorityValue <= CONTEXT_PRIORITY_MAX) + if (priorityValue <= CONTEXT_PRIORITY_MAX) { *priority = priorityValue - CONTEXT_PRIORITY_MAX / 2; } diff --git a/media_softlet/linux/common/os/private/mos_os_specific.cpp b/media_softlet/linux/common/os/private/mos_os_specific.cpp index 22ca116cf36..51bbb8d120b 100644 --- a/media_softlet/linux/common/os/private/mos_os_specific.cpp +++ b/media_softlet/linux/common/os/private/mos_os_specific.cpp @@ -1878,28 +1878,6 @@ MOS_STATUS Mos_Specific_GetIndirectStatePointer( uint32_t offset = 0; uint32_t size = 0; return MosInterface::GetIndirectState(osInterface->osStreamState, indirectState, offset, size); - - MOS_OS_CHK_NULL_RETURN(osInterface->pOsContext); - - osContext = osInterface->pOsContext; - - if (osInterface->CurrentGpuContextHandle == MOS_GPU_CONTEXT_INVALID_HANDLE) - { - MOS_OS_ASSERTMESSAGE("Invalid input parameter gpuContext."); - return MOS_STATUS_INVALID_PARAMETER; - } - - MOS_OS_GPU_CONTEXT &osGpuContext = osContext->OsGpuContext[osInterface->CurrentGpuContextOrdinal]; - - MOS_OS_CHK_NULL_RETURN(osGpuContext.pCB); - MOS_OS_CHK_NULL_RETURN(osGpuContext.pCB->pCmdBase); - - *indirectState = - (uint8_t*)osGpuContext.pCB->pCmdBase + - osGpuContext.uiCommandBufferSize - - osContext->uIndirectStateSize; - - return MOS_STATUS_SUCCESS; } //!