Explorar el Código

[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 hace 7 años
padre
commit
8ef4e7c572
Se han modificado 1 ficheros con 4 adiciones y 1 borrados
  1. 4
    1
      src/core/interface.c

+ 4
- 1
src/core/interface.c Ver fichero

@@ -113,7 +113,10 @@ void intf_plug_plug ( struct interface *a, struct interface *b ) {
113 113
  * @v intf		Object interface
114 114
  */
115 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…
Cancelar
Guardar