]> granicus.if.org Git - libnl/commitdiff
cache: Take cache_ops lock when modifying cache ops flags
authorThomas Graf <tgraf@suug.ch>
Tue, 18 Dec 2012 13:56:26 +0000 (14:56 +0100)
committerThomas Graf <tgraf@suug.ch>
Thu, 27 Dec 2012 12:19:04 +0000 (13:19 +0100)
Signed-off-by: Thomas Graf <tgraf@suug.ch>
lib/cache_mngt.c

index fbb702f68d8f851d2a38a56ff3582cdb3da6e77c..62cde0694b082e86712f84ca5223f8075d3d0a2d 100644 (file)
@@ -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);
 }
 
 /**