From: Imre Deak Date: Wed, 30 Mar 2011 12:45:07 +0000 (+0300) Subject: gpu: pvr: fix incorrect free size in PVRSRVOpenBCDeviceKM X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8e1b1a7e93b9aafe60e931fed4602c6cd92c44ad;p=sgx.git gpu: pvr: fix incorrect free size in PVRSRVOpenBCDeviceKM Also remove the always true condition. Signed-off-by: Imre Deak Reviewed-by: Pauli Nieminen --- diff --git a/pvr/deviceclass.c b/pvr/deviceclass.c index 826f2a7..cfbe18e 100644 --- a/pvr/deviceclass.c +++ b/pvr/deviceclass.c @@ -1304,6 +1304,7 @@ enum PVRSRV_ERROR PVRSRVOpenBCDeviceKM( struct PVRSRV_BUFFERCLASS_INFO *psBCInfo; struct PVRSRV_BUFFERCLASS_PERCONTEXT_INFO *psBCPerContextInfo; struct PVRSRV_DEVICE_NODE *psDeviceNode; + struct BUFFER_INFO sBufferInfo; struct SYS_DATA *psSysData; u32 i; enum PVRSRV_ERROR eError; @@ -1351,8 +1352,6 @@ FoundDevice: OSMemSet(psBCPerContextInfo, 0, sizeof(*psBCPerContextInfo)); if (psBCInfo->ui32RefCount++ == 0) { - struct BUFFER_INFO sBufferInfo; - psDeviceNode = (struct PVRSRV_DEVICE_NODE *)hDevCookie; psBCInfo->hDevMemContext = @@ -1445,12 +1444,9 @@ err3: psKernelSyncInfo); } } - - if (psBCInfo->psBuffer) { - OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, - sizeof(struct PVRSRV_BC_BUFFER), psBCInfo->psBuffer, - NULL); - } + OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, + sizeof(struct PVRSRV_BC_BUFFER) * sBufferInfo.ui32BufferCount, + psBCInfo->psBuffer, NULL); err2: err1: return eError;