summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2022-04-26 06:15:13 (GMT)
committerThomas Haller <thaller@redhat.com>2022-04-26 06:15:20 (GMT)
commit5ecd56cdc7f3729a0c9b6663073d3dfa96776f74 (patch)
tree874a9e2fce72c6e519fc3ba4b59d50e8f0efa461
parente1a077a913da40f05a1c958e679dc1f927d1da60 (diff)
downloadlibnl-5ecd56cdc7f3729a0c9b6663073d3dfa96776f74.zip
libnl-5ecd56cdc7f3729a0c9b6663073d3dfa96776f74.tar.gz
libnl-5ecd56cdc7f3729a0c9b6663073d3dfa96776f74.tar.bz2
route/link: add lock around rtnl_link_af_ops_put()
-rw-r--r--lib/route/link/api.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/route/link/api.c b/lib/route/link/api.c
index 12ddee9..cd2c42b 100644
--- a/lib/route/link/api.c
+++ b/lib/route/link/api.c
@@ -222,8 +222,11 @@ struct rtnl_link_af_ops *rtnl_link_af_ops_lookup(const unsigned int family)
*/
void rtnl_link_af_ops_put(struct rtnl_link_af_ops *ops)
{
- if (ops)
+ if (ops) {
+ nl_write_lock(&info_lock);
ops->ao_refcnt--;
+ nl_write_unlock(&info_lock);
+ }
}
/**