Skip to content

Commit

Permalink
[VP] fix coverity issue 5
Browse files Browse the repository at this point in the history
fix coverity issue5
  • Loading branch information
Dylan-debug authored and intel-mediadev committed Sep 12, 2023
1 parent abdb1ae commit 81d4d60
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,7 @@ MOS_STATUS VpPlatformInterface::InitVpCmKernels(

if (kernel->getName() == nullptr || kernel->getNameLen() < 1 || kernel->getNameLen() > 256)
{
MOS_Delete(isaFile);
VP_PUBLIC_CHK_STATUS_RETURN(MOS_STATUS_INVALID_PARAMETER);
}

Expand Down Expand Up @@ -455,14 +456,19 @@ MOS_STATUS VpPlatformInterface::InitVpCmKernels(

if (kernelBody->getNumInputs() > CM_MAX_ARGS_PER_KERNEL)
{
return MOS_STATUS_INVALID_PARAMETER;
MOS_Delete(isaFile);
VP_PUBLIC_CHK_STATUS_RETURN(MOS_STATUS_INVALID_PARAMETER);
}

for (uint32_t j = 0; j < kernelBody->getNumInputs(); j++)
{
KRN_ARG kernelArg = {};
vISA::InputInfo *inputInfo = kernelBody->getInputInfo()[j];
VP_PUBLIC_CHK_NULL_RETURN(inputInfo);
if (!inputInfo)
{
MOS_Delete(isaFile);
VP_PUBLIC_CHK_STATUS_RETURN(MOS_STATUS_NULL_POINTER);
}
uint8_t kind = inputInfo->getKind();

if (kind == 0x2) // compiler value for surface
Expand Down

0 comments on commit 81d4d60

Please sign in to comment.