* 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:
@@ -357,13 +357,15 @@ list_device_interfaces(void* _buffer, size_t* bufferSize)
|
|||||||
void
|
void
|
||||||
put_device_interface(struct net_device_interface* interface)
|
put_device_interface(struct net_device_interface* interface)
|
||||||
{
|
{
|
||||||
|
if (interface == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
if (atomic_add(&interface->ref_count, -1) != 1)
|
if (atomic_add(&interface->ref_count, -1) != 1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
{
|
MutexLocker locker(sLock);
|
||||||
MutexLocker locker(sLock);
|
sInterfaces.Remove(interface);
|
||||||
sInterfaces.Remove(interface);
|
locker.Unlock();
|
||||||
}
|
|
||||||
|
|
||||||
uninit_fifo(&interface->receive_queue);
|
uninit_fifo(&interface->receive_queue);
|
||||||
status_t status;
|
status_t status;
|
||||||
|
|||||||
Reference in New Issue
Block a user