tree 45eaecaad3831ecb12a7230c37545ff40e7ec82c
parent 48fc30a563a5cf0fdeacb1f9f75b4b009a8bdd62
author Arnaldo Carvalho de Melo <[EMAIL PROTECTED]> Tue Apr 12 08:24:45 2005
committer Linus Torvalds <[EMAIL PROTECTED]> Tue Apr 12 08:24:45 2005
[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]>
sock.c | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
Index: net/core/sock.c
===================================================================
--- 3ed392477c70ed1858572ab3b0b1b2c5594e5775/net/core/sock.c (mode:100644
sha1:f95d9334dad3574a02b62f0c575dfe4b72808bc7)
+++ 45eaecaad3831ecb12a7230c37545ff40e7ec82c/net/core/sock.c (mode:100644
sha1:4c5626a392ccacddb1e247a2d1ae91a33dbf6808)
@@ -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