david/ipxe
david
/
ipxe
Archived
1
0
Fork 0

[interface] Avoid unnecessary reference counting in intf_unplug()

The null interface does not have a reference counter, so the call to
intf_get() is always redundant.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown 2017-01-25 10:11:26 +00:00
parent 941c53a3bf
commit 8ef4e7c572
1 changed files with 4 additions and 1 deletions

View File

@ -113,7 +113,10 @@ void intf_plug_plug ( struct interface *a, struct interface *b ) {
* @v intf Object interface
*/
void intf_unplug ( struct interface *intf ) {
intf_plug ( intf, &null_intf );
DBGC ( INTF_COL ( intf ), "INTF " INTF_INTF_FMT " unplug\n",
INTF_INTF_DBG ( intf, intf->dest ) );
intf_put ( intf->dest );
intf->dest = &null_intf;
}
/**