Signed-off-by: Thomas Graf <tgraf@suug.ch>
int family)
{
struct rtnl_link_af_ops *af_ops = rtnl_link_af_ops_lookup(family);
+ int ret = 0;
if (!af_ops)
return ~0;
if (!a->l_af_data[family] && !b->l_af_data[family])
- return 0;
+ goto out;
- if (!a->l_af_data[family] || !b->l_af_data[family])
- return ~0;
+ if (!a->l_af_data[family] || !b->l_af_data[family]) {
+ ret = ~0;
+ goto out;
+ }
if (af_ops->ao_compare)
- return af_ops->ao_compare(a, b, family, ~0, 0);
+ ret = af_ops->ao_compare(a, b, family, ~0, 0);
+out:
+ rtnl_link_af_ops_put(af_ops);
- return 0;
+ return ret;
}
/** @} */