Module Name:    src
Committed By:   mlelstv
Date:           Wed Oct  3 12:24:56 UTC 2012

Modified Files:
        src/sys/net/npf: npf_rproc.c

Log Message:
ext_ops does not change during the life cycle and can be fetched without
the mutex held. This avoids confusion in the compiler about an uninitialized
variable ext_ops.
ok rmind@


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/net/npf/npf_rproc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/net/npf/npf_rproc.c
diff -u src/sys/net/npf/npf_rproc.c:1.3 src/sys/net/npf/npf_rproc.c:1.4
--- src/sys/net/npf/npf_rproc.c:1.3	Sun Sep 16 13:47:41 2012
+++ src/sys/net/npf/npf_rproc.c	Wed Oct  3 12:24:56 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: npf_rproc.c,v 1.3 2012/09/16 13:47:41 rmind Exp $	*/
+/*	$NetBSD: npf_rproc.c,v 1.4 2012/10/03 12:24:56 mlelstv Exp $	*/
 
 /*-
  * Copyright (c) 2009-2012 The NetBSD Foundation, Inc.
@@ -164,14 +164,16 @@ npf_ext_construct(const char *name, npf_
 	ext = npf_ext_lookup(name);
 	if (ext) {
 		atomic_inc_uint(&ext->ext_refcnt);
-		extops = ext->ext_ops;
-		KASSERT(extops != NULL);
 	}
 	mutex_exit(&ext_lock);
+
 	if (!ext) {
 		return ENOENT;
 	}
 
+	extops = ext->ext_ops;
+	KASSERT(extops != NULL);
+
 	error = extops->ctor(rp, params);
 	if (error) {
 		atomic_dec_uint(&ext->ext_refcnt);

Reply via email to