Skip to content

Commit

Permalink
[VP] fix coverity issue 4
Browse files Browse the repository at this point in the history
fix coverity issue4
  • Loading branch information
Dylan-debug authored and intel-mediadev committed Sep 11, 2023
1 parent 186e0da commit 22dc216
Showing 1 changed file with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -403,13 +403,21 @@ MOS_STATUS VpPlatformInterface::InitVpCmKernels(
}

vISA::Header *header = isaFile->getHeader();
VP_PUBLIC_CHK_NULL_RETURN(header);
if(!header)
{
MOS_Delete(isaFile);
VP_PUBLIC_CHK_STATUS_RETURN(MOS_STATUS_NULL_POINTER);
}

for (uint32_t i = 0; i < header->getNumKernels(); i++)
{
vISA::Kernel *kernel = header->getKernelInfo()[i];

VP_PUBLIC_CHK_NULL_RETURN(kernel);
if(!kernel)
{
MOS_Delete(isaFile);
VP_PUBLIC_CHK_STATUS_RETURN(MOS_STATUS_NULL_POINTER);
}

if (kernel->getName() == nullptr || kernel->getNameLen() < 1 || kernel->getNameLen() > 256)
{
Expand Down Expand Up @@ -439,7 +447,11 @@ MOS_STATUS VpPlatformInterface::InitVpCmKernels(
vpKernel.SetKernelBinSize(genBinary->getBinarySize());

vISA::KernelBody *kernelBody = isaFile->getKernelsData().at(i);
VP_PUBLIC_CHK_NULL_RETURN(kernelBody);
if(!kernelBody)
{
MOS_Delete(isaFile);
VP_PUBLIC_CHK_STATUS_RETURN(MOS_STATUS_NULL_POINTER);
}

if (kernelBody->getNumInputs() > CM_MAX_ARGS_PER_KERNEL)
{
Expand Down

0 comments on commit 22dc216

Please sign in to comment.