From de213328f810afbf39380561855507c8b8c78e08 Mon Sep 17 00:00:00 2001 From: Thomas Graf Date: Tue, 18 Dec 2012 14:56:26 +0100 Subject: cache: Take cache_ops lock when modifying cache ops flags Signed-off-by: Thomas Graf --- lib/cache_mngt.c | 2 ++ 1 file changed, 2 insertions(+) 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); } /** -- cgit v0.12