diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2015-07-14 09:43:01 (GMT) |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2015-08-14 14:12:49 (GMT) |
commit | ffe58f3203336250f15093a25ddc9056640e281e (patch) | |
tree | 862d2110df59fbe02502f05724738ef0a9531880 /lib/route | |
parent | 85b0038c8bdef96e8e8efe10622a8aebee174214 (diff) | |
download | libnl-ffe58f3203336250f15093a25ddc9056640e281e.zip libnl-ffe58f3203336250f15093a25ddc9056640e281e.tar.gz libnl-ffe58f3203336250f15093a25ddc9056640e281e.tar.bz2 |
route/link: Remove unnecessary NULL check before release_link_info()
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>
Diffstat (limited to 'lib/route')
-rw-r--r-- | lib/route/link.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/route/link.c b/lib/route/link.c index 35946bd..bee1048 100644 --- a/lib/route/link.c +++ b/lib/route/link.c @@ -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; |