tree d76f7f634e43bf3797657c5cb2d2b222ffd76f8b
parent 9f3786dc8b1d6229dbe76e364323f0d787e7a0ea
author Arnaldo Carvalho de Melo <[EMAIL PROTECTED]> Sun, 17 Apr 2005 05:24:09 
-0700
committer Linus Torvalds <[EMAIL PROTECTED]> Sun, 17 Apr 2005 05:24:09 -0700

[PATCH] net: don't call kmem_cache_create with a spinlock held

This fixes the warning reported by Marcel Holtmann (Thanks!).
  
Signed-off-by: Arnaldo Carvalho de Melo <[EMAIL PROTECTED]>
Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>

 core/sock.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

Index: net/core/sock.c
===================================================================
--- 9becf7cb07d0bcd3fa638b66e389f9cd6ed6d52a/net/core/sock.c  (mode:100644 
sha1:629ab4a5b45b5a0c45b100752080fc9a4d816980)
+++ d76f7f634e43bf3797657c5cb2d2b222ffd76f8b/net/core/sock.c  (mode:100644 
sha1:f52c87a9268a772398e937a80730d576ab32a066)
@@ -1359,8 +1359,6 @@
 {
        int rc = -ENOBUFS;
 
-       write_lock(&proto_list_lock);
-
        if (alloc_slab) {
                prot->slab = kmem_cache_create(prot->name, prot->obj_size, 0,
                                               SLAB_HWCACHE_ALIGN, NULL, NULL);
@@ -1368,14 +1366,15 @@
                if (prot->slab == NULL) {
                        printk(KERN_CRIT "%s: Can't create sock SLAB cache!\n",
                               prot->name);
-                       goto out_unlock;
+                       goto out;
                }
        }
 
+       write_lock(&proto_list_lock);
        list_add(&prot->node, &proto_list);
-       rc = 0;
-out_unlock:
        write_unlock(&proto_list_lock);
+       rc = 0;
+out:
        return rc;
 }
 
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to