gpu: pvr: Check OSAllocMem return value.
authorJanusz Sobczak <janusz.sobczak@imgtec.com>
Mon, 9 Aug 2010 11:22:13 +0000 (13:22 +0200)
committerGrazvydas Ignotas <notasas@gmail.com>
Sun, 20 May 2012 18:09:42 +0000 (21:09 +0300)
Check OSAllocMem() return value instead of checking the pointer returned
as a positional parameter.

This change makes static analysis tool happy.

Signed-off-by: Janusz Sobczak <janusz.sobczak@imgtec.com>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
pvr/hash.c

index 318d9dd..53593a6 100644 (file)
@@ -202,11 +202,9 @@ struct HASH_TABLE *HASH_Create_Extended(u32 uInitialLen, size_t uKeySize,
        pHash->pfnHashFunc = pfnHashFunc;
        pHash->pfnKeyComp = pfnKeyComp;
 
-       OSAllocMem(PVRSRV_PAGEABLE_SELECT,
+       if (OSAllocMem(PVRSRV_PAGEABLE_SELECT,
                   sizeof(struct BUCKET *) * pHash->uSize,
-                  (void **) &pHash->ppBucketTable, NULL);
-
-       if (pHash->ppBucketTable == NULL) {
+                  (void **) &pHash->ppBucketTable, NULL) != PVRSRV_OK) {
                OSFreeMem(PVRSRV_PAGEABLE_SELECT, sizeof(struct HASH_TABLE),
                          pHash, NULL);
                return NULL;