gpu: pvr: Check OSAllocMem return value.
authorJanusz Sobczak <janusz.sobczak@imgtec.com>
Mon, 9 Aug 2010 11:22:59 +0000 (13:22 +0200)
committerGrazvydas Ignotas <notasas@gmail.com>
Sun, 20 May 2012 18:09:42 +0000 (21:09 +0300)
Signed-off-by: Janusz Sobczak <janusz.sobczak@imgtec.com>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
pvr/mmu.c

index 3e7096a..728e735 100644 (file)
--- a/pvr/mmu.c
+++ b/pvr/mmu.c
@@ -499,9 +499,9 @@ enum PVRSRV_ERROR MMU_Initialise(struct PVRSRV_DEVICE_NODE *psDeviceNode,
                return PVRSRV_ERROR_GENERIC;
        }
 
-       OSAllocMem(PVRSRV_OS_PAGEABLE_HEAP,
-                  sizeof(struct MMU_CONTEXT), (void **) &psMMUContext, NULL);
-       if (psMMUContext == NULL) {
+       if (OSAllocMem(PVRSRV_OS_PAGEABLE_HEAP,
+                  sizeof(struct MMU_CONTEXT), (void **) &psMMUContext, NULL)
+                       != PVRSRV_OK) {
                PVR_DPF(PVR_DBG_ERROR,
                         "MMU_Initialise: ERROR call to OSAllocMem failed");
                return PVRSRV_ERROR_GENERIC;