瀏覽代碼

[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 9 年之前
父節點
當前提交
8ef4e7c572
共有 1 個檔案被更改,包括 4 行新增1 行删除
  1. 4
    1
      src/core/interface.c

+ 4
- 1
src/core/interface.c 查看文件

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…
取消
儲存