summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorMichael Brown2017-01-25 11:11:26 +0100
committerMichael Brown2017-01-25 11:16:36 +0100
commit8ef4e7c572d6cf4feb6578d253a0268bc603ad16 (patch)
tree965f24439f83dadab67e83a77ccf3a7627a29958 /src/core
parent[efi] Fix building elf2efi.c when -fpic is enabled by default (diff)
downloadipxe-8ef4e7c572d6cf4feb6578d253a0268bc603ad16.tar.gz
ipxe-8ef4e7c572d6cf4feb6578d253a0268bc603ad16.tar.xz
ipxe-8ef4e7c572d6cf4feb6578d253a0268bc603ad16.zip
[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>
Diffstat (limited to 'src/core')
-rw-r--r--src/core/interface.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/core/interface.c b/src/core/interface.c
index 948fa5c5..faaa931f 100644
--- a/src/core/interface.c
+++ b/src/core/interface.c
@@ -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;
}
/**