]> granicus.if.org Git - libnl/commitdiff
route/link: Remove unnecessary NULL check before release_link_info()
authorTobias Klauser <tklauser@distanz.ch>
Tue, 14 Jul 2015 09:43:01 +0000 (11:43 +0200)
committerThomas Haller <thaller@redhat.com>
Fri, 14 Aug 2015 14:12:49 +0000 (16:12 +0200)
release_link_info() already check whether link->l_info_ops is not NULL
before accessing it, thus there is no need to do the same before calling
it.

http://lists.infradead.org/pipermail/libnl/2015-July/001929.html

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
lib/route/link.c

index 35946bdbf55042ccb2be2a30a0dfa07302e9981b..bee104828fe578f654afb633d77154f311d58c0d 100644 (file)
@@ -208,10 +208,7 @@ static void link_free_data(struct nl_object *c)
        struct rtnl_link *link = nl_object_priv(c);
 
        if (link) {
-               struct rtnl_link_info_ops *io;
-
-               if ((io = link->l_info_ops) != NULL)
-                       release_link_info(link);
+               release_link_info(link);
 
                /* proto info af reference */
                rtnl_link_af_ops_put(link->l_af_ops);
@@ -2237,8 +2234,7 @@ int rtnl_link_set_type(struct rtnl_link *link, const char *type)
 
        free(link->l_info_kind);
        link->ce_mask &= ~LINK_ATTR_LINKINFO;
-       if (link->l_info_ops)
-               release_link_info(link);
+       release_link_info(link);
 
        if (!type)
                return 0;