Skip to content

Commit

Permalink
[interface] Avoid unnecessary reference counting in intf_unplug()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
mcb30 committed Jan 25, 2017
1 parent 941c53a commit 8ef4e7c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/core/interface.c
Expand Up @@ -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;
}

/**
Expand Down

0 comments on commit 8ef4e7c

Please sign in to comment.