From 8ef4e7c572d6cf4feb6578d253a0268bc603ad16 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Wed, 25 Jan 2017 10:11:26 +0000 Subject: [PATCH] [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 --- src/core/interface.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; } /**