{
struct PVRSRV_DISPLAYCLASS_INFO *psDCInfo;
struct PVRSRV_DISPLAYCLASS_PERCONTEXT_INFO *psDCPerContextInfo;
+ struct PVRSRV_DC_SRV2DISP_KMJTABLE *jtbl;
struct PVRSRV_DEVICE_NODE *psDeviceNode;
struct SYS_DATA *psSysData;
+ enum PVRSRV_ERROR eError;
if (!phDeviceKM || !hDevCookie) {
PVR_DPF(PVR_DBG_ERROR,
OSMemSet(psDCPerContextInfo, 0, sizeof(*psDCPerContextInfo));
if (psDCInfo->ui32RefCount++ == 0) {
- enum PVRSRV_ERROR eError;
- struct PVRSRV_DC_SRV2DISP_KMJTABLE *jtbl;
-
psDeviceNode = (struct PVRSRV_DEVICE_NODE *)hDevCookie;
jtbl = psDCInfo->psFuncTable;
if (!try_module_get(jtbl->owner)) {
PVR_DPF(PVR_DBG_ERROR, "%s: can't get DC module");
- return PVRSRV_ERROR_INVALID_DEVICE;
+ eError = PVRSRV_ERROR_INVALID_DEVICE;
+
+ goto err1;
}
psDCInfo->hDevMemContext =
if (eError != PVRSRV_OK) {
PVR_DPF(PVR_DBG_ERROR,
"PVRSRVOpenDCDeviceKM: Failed sync info alloc");
- psDCInfo->ui32RefCount--;
- module_put(jtbl->owner);
- return eError;
+
+ goto err2;
}
eError = jtbl->pfnOpenDCDevice(ui32DeviceID,
if (eError != PVRSRV_OK) {
PVR_DPF(PVR_DBG_ERROR, "PVRSRVOpenDCDeviceKM: "
"Failed to open external DC device");
- psDCInfo->ui32RefCount--;
- module_put(jtbl->owner);
- PVRSRVFreeSyncInfoKM(psDCInfo->sSystemBuffer.
- sDeviceClassBuffer.psKernelSyncInfo);
- return eError;
+ goto err3;
}
}
*phDeviceKM = (void *) psDCPerContextInfo;
return PVRSRV_OK;
+err3:
+ PVRSRVFreeSyncInfoKM(psDCInfo->sSystemBuffer.
+ sDeviceClassBuffer.psKernelSyncInfo);
+err2:
+ module_put(jtbl->owner);
+ psDCInfo->ui32RefCount--;
+err1:
+ return eError;
}
enum PVRSRV_ERROR PVRSRVEnumDCFormatsKM(void *hDeviceKM,