gpu: pvr: Check SysAcquireData return value.
authorJanusz Sobczak <janusz.sobczak@imgtec.com>
Mon, 9 Aug 2010 11:23:36 +0000 (13:23 +0200)
committerGrazvydas Ignotas <notasas@gmail.com>
Sun, 20 May 2012 18:09:42 +0000 (21:09 +0300)
SysAcquireData() could theoretically fail.
This patch adds missing return value check in SGXReadDiffCountersKM().

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

index 10dbc5a..39c3cf9 100644 (file)
@@ -1531,7 +1531,8 @@ enum PVRSRV_ERROR SGXReadDiffCountersKM(void *hDevHandle, u32 ui32Reg,
                psDevInfo->ui32HWGroupRequested = ui32New;
        psDevInfo->ui32HWReset |= ui32NewReset;
 
-       SysAcquireData(&psSysData);
+       if (SysAcquireData(&psSysData) != PVRSRV_OK)
+               return PVRSRV_ERROR_GENERIC;
 
        psPowerDevice = psSysData->psPowerDeviceList;
        while (psPowerDevice) {