Browse Source

[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>
tags/v1.20.1
Michael Brown 7 years ago
parent
commit
8ef4e7c572
1 changed files with 4 additions and 1 deletions
  1. 4
    1
      src/core/interface.c

+ 4
- 1
src/core/interface.c View File

113
  * @v intf		Object interface
113
  * @v intf		Object interface
114
  */
114
  */
115
 void intf_unplug ( struct interface *intf ) {
115
 void intf_unplug ( struct interface *intf ) {
116
-	intf_plug ( intf, &null_intf );
116
+	DBGC ( INTF_COL ( intf ), "INTF " INTF_INTF_FMT " unplug\n",
117
+	       INTF_INTF_DBG ( intf, intf->dest ) );
118
+	intf_put ( intf->dest );
119
+	intf->dest = &null_intf;
117
 }
120
 }
118
 
121
 
119
 /**
122
 /**

Loading…
Cancel
Save