@@ -1545,18 +1545,23 @@ DSP_STATUS DRV_ReleaseResources(u32 dwContext, struct DRV_OBJECT *hDrvObject)
for (pszdevNode = (struct DRV_EXT *)DRV_GetFirstDevExtension();
pszdevNode != NULL; pszdevNode = (struct DRV_EXT *)
DRV_GetNextDevExtension((u32)pszdevNode)) {
+ if (!pDRVObject->devNodeString)
+ /* List already deleted */
+ break;
+
if ((u32)pszdevNode == dwContext) {
/* Found it */
/* Delete from the Driver object list */
LST_RemoveElem(pDRVObject->devNodeString,
- (struct LST_ELEM *)pszdevNode);
+ (struct LST_ELEM *) pszdevNode);
MEM_Free((void *) pszdevNode);
- break;
}
+
/* Delete the List if it is empty */
if (LST_IsEmpty(pDRVObject->devNodeString)) {
LST_Delete(pDRVObject->devNodeString);
pDRVObject->devNodeString = NULL;
+ break;
}
}
return status;