summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Graf <tgraf@suug.ch>2012-12-18 13:56:26 (GMT)
committerThomas Graf <tgraf@suug.ch>2012-12-27 12:19:04 (GMT)
commitde213328f810afbf39380561855507c8b8c78e08 (patch)
tree32c845ce3cdb89e87dc321d5353afb1d5e90f339
parent96bb7c9a4cdd10a2665c0f56120943e79e33c560 (diff)
downloadlibnl-de213328f810afbf39380561855507c8b8c78e08.zip
libnl-de213328f810afbf39380561855507c8b8c78e08.tar.gz
libnl-de213328f810afbf39380561855507c8b8c78e08.tar.bz2
cache: Take cache_ops lock when modifying cache ops flags
Signed-off-by: Thomas Graf <tgraf@suug.ch>
-rw-r--r--lib/cache_mngt.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/cache_mngt.c b/lib/cache_mngt.c
index fbb702f..62cde06 100644
--- a/lib/cache_mngt.c
+++ b/lib/cache_mngt.c
@@ -235,7 +235,9 @@ void nl_cache_ops_foreach(void (*cb)(struct nl_cache_ops *, void *), void *arg)
*/
void nl_cache_ops_set_flags(struct nl_cache_ops *ops, unsigned int flags)
{
+ nl_write_lock(&cache_ops_lock);
ops->co_flags |= flags;
+ nl_write_unlock(&cache_ops_lock);
}
/**