LF-2478 [#ccc] fix the dereferencing null pointer

Signed-off-by: Jiyu Yang <jiyu.yang@nxp.com>
This commit is contained in:
Jiyu Yang 2020-10-31 10:06:08 +08:00 committed by Xianzhong
parent 74a6e073f4
commit c9f470a8bf
1 changed files with 2 additions and 3 deletions

View File

@ -745,13 +745,12 @@ gckKERNEL_Construct(
return gcvSTATUS_OK;
OnError:
gckOS_SetGPUPower(Os, kernel->core, gcvFALSE, gcvFALSE);
*Kernel = gcvNULL;
if (kernel != gcvNULL)
{
gckOS_SetGPUPower(Os, kernel->core, gcvFALSE, gcvFALSE);
gckKERNEL_Destroy(kernel);
}
*Kernel = gcvNULL;
/* Return the error. */
gcmkFOOTER();