Skip to content

Commit 82a4eb9

Browse files
Dylan-debugintel-mediadev
authored andcommitted
[Media Common] [VP] fix coverityent issue
fix coverityent issue!
1 parent 964ffce commit 82a4eb9

File tree

8 files changed

+20
-12
lines changed

8 files changed

+20
-12
lines changed

media_driver/agnostic/common/os/mos_os_virtualengine.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ MOS_STATUS Mos_VirtualEngineInterface_Initialize(
9797

9898
if (pOsInterface->apoMosEnabled)
9999
{
100+
MOS_OS_CHK_NULL(pOsInterface->osStreamState);
100101
if (pVEInitParms->bScalabilitySupported)
101102
{
102103
pVEInterf->veInterface = MOS_New(MosOsVeScalabilitySpecific);
@@ -106,12 +107,13 @@ MOS_STATUS Mos_VirtualEngineInterface_Initialize(
106107
pVEInterf->veInterface = MOS_New(MosOsVeSinglePipeSpecific);
107108
}
108109
MOS_OS_CHK_NULL(pVEInterf->veInterface);
109-
MOS_OS_CHK_NULL(pOsInterface->osStreamState);
110110
pVEInterf->veInterface->Initialize(pOsInterface->osStreamState, pVEInitParms);
111111
pOsInterface->osStreamState->virtualEngineInterface = pVEInterf->veInterface;
112112
}
113+
return eStatus;
113114

114115
finish:
116+
MOS_SafeFreeMemory(pVEInterf);
115117
return eStatus;
116118
}
117119

media_driver/agnostic/common/vp/hal/vphal_renderer.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1002,7 +1002,12 @@ void VphalRenderer::UpdateReport(
10021002
{
10031003
MOS_ZeroMemory(&Info, sizeof(VPHAL_GET_SURFACE_INFO));
10041004

1005-
VpHal_GetSurfaceInfo(m_pOsInterface, &Info, pRenderParams->pTarget[0]);
1005+
MOS_STATUS status = VpHal_GetSurfaceInfo(m_pOsInterface, &Info, pRenderParams->pTarget[0]);
1006+
if (MOS_STATUS_SUCCESS != status)
1007+
{
1008+
VPHAL_PUBLIC_ASSERTMESSAGE("VpHal_GetSurfaceInfo failed!");
1009+
return;
1010+
}
10061011
m_reporting->GetFeatures().rtCompressible = true;
10071012
m_reporting->GetFeatures().rtCompressMode = (uint8_t)(pRenderParams->pTarget[0]->CompressionMode);
10081013
}

media_driver/agnostic/gen12/hw/mhw_state_heap_g12.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,8 @@ MOS_STATUS MHW_STATE_HEAP_INTERFACE_G12_X::AddInterfaceDescriptorData(
151151

152152
// need to subtract memory block's offset in current state heap for AddData API
153153
offset -= pParams->memoryBlock->GetOffset();
154-
pParams->memoryBlock->AddData(pInterfaceDescriptor, offset,
155-
sizeof(mhw_state_heap_g12_X::INTERFACE_DESCRIPTOR_DATA_CMD));
154+
MHW_MI_CHK_STATUS(pParams->memoryBlock->AddData(pInterfaceDescriptor, offset,
155+
sizeof(mhw_state_heap_g12_X::INTERFACE_DESCRIPTOR_DATA_CMD)));
156156

157157
MOS_SafeFreeMemory(pInterfaceDescriptor);
158158

media_driver/agnostic/gen12/vp/hal/vphal_render_composite_g12.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ class CompositeStateG12 : virtual public CompositeState
6969
m_bYV12iAvsScaling = true; // On Gen9+, iAVS scaling can support YV12 input format
7070
m_bEnableSamplerLumakey = true;
7171

72+
if (!peStatus)
73+
{
74+
VPHAL_PUBLIC_ASSERTMESSAGE("Got null peStatus!");
75+
return;
76+
}
77+
7278
if (*peStatus != MOS_STATUS_SUCCESS)
7379
{
7480
// super class constructor failed, return directly

media_softlet/agnostic/common/hw/mhw_sfc_impl.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,6 @@ class Impl : public Itf, public mhw::Impl
6868
m_indexofSfc = 0;
6969
m_numofSfc = 1;
7070

71-
if (osItf == nullptr)
72-
{
73-
MHW_ASSERTMESSAGE("Invalid Input Parameter: m_osInterface is nullptr");
74-
return;
75-
}
76-
7771
// Get Memory control object directly from MOS.
7872
// If any override is needed, something like pfnOverrideMemoryObjectCtrl() / pfnComposeSurfaceCacheabilityControl()
7973
// will need to be implemented.

media_softlet/agnostic/common/hw/mhw_state_heap.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1009,7 +1009,7 @@ MOS_STATUS XMHW_STATE_HEAP_INTERFACE::InitializeInterface(
10091009

10101010
m_dshManager.RegisterOsInterface(m_pOsInterface);
10111011
m_dshManager.SetDefaultBehavior(StateHeapSettings.m_dshBehavior);
1012-
m_dshManager.SetInitialHeapSize(StateHeapSettings.dwDshSize);
1012+
MHW_MI_CHK_STATUS(m_dshManager.SetInitialHeapSize(StateHeapSettings.dwDshSize));
10131013
if (StateHeapSettings.m_dshBehavior == HeapManager::Behavior::extend ||
10141014
StateHeapSettings.m_dshBehavior == HeapManager::Behavior::destructiveExtend ||
10151015
StateHeapSettings.m_dshBehavior == HeapManager::Behavior::waitAndExtend)

media_softlet/agnostic/common/vp/hal/feature_manager/policy.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3107,6 +3107,7 @@ MOS_STATUS Policy::LayerSelectForProcess(std::vector<int> &layerIndexes, SwFilte
31073107
VP_PUBLIC_NORMALMESSAGE("target, gpuVa = 0x%llx", gpuVa);
31083108

31093109
PolicyFcHandler *fcHandler = dynamic_cast<PolicyFcHandler *>(it->second);
3110+
VP_PUBLIC_CHK_NULL_RETURN(fcHandler);
31103111
VP_PUBLIC_CHK_STATUS_RETURN(fcHandler->LayerSelectForProcess(layerIndexes, featurePipe, caps));
31113112

31123113
if (layerIndexes.size() < featurePipe.GetSurfaceCount(true))

media_softlet/agnostic/common/vp/hal/features/vp_csc_filter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ MOS_STATUS VpCscFilter::CalculateSfcEngineParams()
246246
m_sfcCSCParams->iefParams = m_cscParams.pIEFParams;
247247
}
248248

249-
m_cscParams.input.colorSpace = m_cscParams.input.colorSpace;
249+
m_sfcCSCParams->inputColorSpace = m_cscParams.input.colorSpace;
250250

251251
// IsDitheringNeeded should be called before input format being updated by GetSfcInputFormat
252252
m_sfcCSCParams->isDitheringNeeded = IsDitheringNeeded(m_cscParams.formatInput, m_cscParams.formatOutput);

0 commit comments

Comments
 (0)