gpu: pvr: fix error path in PVRSRVOpenBCDeviceKM
authorImre Deak <imre.deak@nokia.com>
Wed, 30 Mar 2011 12:37:04 +0000 (15:37 +0300)
committerGrazvydas Ignotas <notasas@gmail.com>
Sun, 20 May 2012 18:43:04 +0000 (21:43 +0300)
Add missing frees / ref count rollback.

Reported-by: Coverity
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Reviewed-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com>
pvr/deviceclass.c

index cfbe18e..ed959d7 100644 (file)
@@ -1448,7 +1448,12 @@ err3:
                  sizeof(struct PVRSRV_BC_BUFFER) * sBufferInfo.ui32BufferCount,
                  psBCInfo->psBuffer, NULL);
 err2:
+       psBCInfo->psFuncTable->pfnCloseBCDevice(psBCInfo->hExtDevice);
 err1:
+       OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(*psBCPerContextInfo),
+                 psBCPerContextInfo, NULL);
+       psBCInfo->ui32RefCount--;
+
        return eError;
 }