]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[interface] Avoid unnecessary reference counting in intf_unplug()
authorMichael Brown <mcb30@ipxe.org>
Wed, 25 Jan 2017 10:11:26 +0000 (10:11 +0000)
committerMichael Brown <mcb30@ipxe.org>
Wed, 25 Jan 2017 10:16:36 +0000 (10:16 +0000)
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>
src/core/interface.c

index 948fa5c54421f2e834e28abc31c4da79978d32dd..faaa931f29e296aac16a4bbace96739efc50db9d 100644 (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;
 }
 
 /**