From e02b1a86208df7c7f2ae1d79e65597f02d8f6d27 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 11 Feb 2014 13:08:23 +0100 Subject: [PATCH] platform: refactor link_get() not to use auto_nl_object The previous implementation called nl_object_get() and nl_object_put() each time in link_get(). As nl_object_get() and nl_object_put() causes debug logging in libnl, this clutters the output. Signed-off-by: Thomas Haller --- src/platform/nm-linux-platform.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c index 81630fe60b..8177f230f0 100644 --- a/src/platform/nm-linux-platform.c +++ b/src/platform/nm-linux-platform.c @@ -1487,7 +1487,7 @@ static struct rtnl_link * link_get (NMPlatform *platform, int ifindex) { NMLinuxPlatformPrivate *priv = NM_LINUX_PLATFORM_GET_PRIVATE (platform); - auto_nl_object struct rtnl_link *rtnllink = rtnl_link_get (priv->link_cache, ifindex); + struct rtnl_link *rtnllink = rtnl_link_get (priv->link_cache, ifindex); if (!rtnllink) { platform->error = NM_PLATFORM_ERROR_NOT_FOUND; @@ -1497,10 +1497,10 @@ link_get (NMPlatform *platform, int ifindex) /* physical interfaces must be found by udev before they can be used */ if (!link_is_announceable (platform, rtnllink)) { platform->error = NM_PLATFORM_ERROR_NOT_FOUND; + rtnl_link_put (rtnllink); return NULL; } - nl_object_get ((struct nl_object *) rtnllink); return rtnllink; }