Dereferencing a pointer may only happen after NULL check to avoid crash
if the pointer is NULL.
[pvr/services4/srvkm/common/buffer_manager.c:1152]: (error) Possible
null pointer dereference: psBMHeap - otherwise it is redundant to check
if psBMHeap is null at line 1156
Reported-by: Olev Kartau <olev.kartau@intel.com>
Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
BM_DestroyHeap (IMG_HANDLE hDevMemHeap)
{
BM_HEAP* psBMHeap = (BM_HEAP*)hDevMemHeap;
- PVRSRV_DEVICE_NODE *psDeviceNode = psBMHeap->pBMContext->psDeviceNode;
+ PVRSRV_DEVICE_NODE *psDeviceNode;
PVR_DPF((PVR_DBG_MESSAGE, "BM_DestroyHeap"));
if(psBMHeap)
{
+ psDeviceNode = psBMHeap->pBMContext->psDeviceNode;
if(psBMHeap->ui32Attribs
& (PVRSRV_BACKINGSTORE_SYSMEM_NONCONTIG