Fixed a bug and memory leak in PPPManager.

Added *very* naive semaphore-deletion detection code to ethernet module (fixes crashing bug on unload).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14409 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Waldemar Kornewald 2005-10-18 18:35:13 +00:00
parent 26abf74673
commit a957e4c978
2 changed files with 8 additions and 3 deletions

View File

@ -377,10 +377,13 @@ int32 ether_input(void *data)
struct mbuf *m;
struct ether_header *eth;
int len;
status_t error = B_OK;
while (1) {
len = sizeof(struct ether_header);
acquire_sem_etc(etherq->pop, 1, B_CAN_INTERRUPT, 0);
error = acquire_sem_etc(etherq->pop, 1, B_CAN_INTERRUPT, 0);
if(error != B_NO_ERROR)
return error;
IFQ_DEQUEUE(etherq, m);
if (!m)
continue;
@ -428,7 +431,7 @@ int32 ether_input(void *data)
}
}
return 0;
return error;
}
#define senderr(e) { error = (e); goto bad; }

View File

@ -93,9 +93,11 @@ PPPManager::~PPPManager()
app = fApps.ItemAt(index);
if(app) {
free(app->interfaceName);
delete entry;
delete app;
}
}
free(fDefaultInterface);
}