* put_device_interface() now also accepts a NULL pointer.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37852 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2010-08-02 21:17:33 +00:00
parent edf1018372
commit 67678a989e

View File

@ -357,13 +357,15 @@ list_device_interfaces(void* _buffer, size_t* bufferSize)
void
put_device_interface(struct net_device_interface* interface)
{
if (interface == NULL)
return;
if (atomic_add(&interface->ref_count, -1) != 1)
return;
{
MutexLocker locker(sLock);
sInterfaces.Remove(interface);
}
MutexLocker locker(sLock);
sInterfaces.Remove(interface);
locker.Unlock();
uninit_fifo(&interface->receive_queue);
status_t status;