diff options
author | Arnaldo Carvalho de Melo <acme@conectiva.com.br> | 2005-04-16 18:24:09 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:24:09 -0400 |
commit | 2a27805127aee1e7e62854bcf9ca8c355c23b73e (patch) | |
tree | d76f7f634e43bf3797657c5cb2d2b222ffd76f8b /net/core/sock.c | |
parent | 9f3786dc8b1d6229dbe76e364323f0d787e7a0ea (diff) |
[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 <acme@conectiva.com.br>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'net/core/sock.c')
-rw-r--r-- | net/core/sock.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/net/core/sock.c b/net/core/sock.c index 629ab4a5b45b..f52c87a9268a 100644 --- a/net/core/sock.c +++ b/net/core/sock.c | |||
@@ -1359,8 +1359,6 @@ int proto_register(struct proto *prot, int alloc_slab) | |||
1359 | { | 1359 | { |
1360 | int rc = -ENOBUFS; | 1360 | int rc = -ENOBUFS; |
1361 | 1361 | ||
1362 | write_lock(&proto_list_lock); | ||
1363 | |||
1364 | if (alloc_slab) { | 1362 | if (alloc_slab) { |
1365 | prot->slab = kmem_cache_create(prot->name, prot->obj_size, 0, | 1363 | prot->slab = kmem_cache_create(prot->name, prot->obj_size, 0, |
1366 | SLAB_HWCACHE_ALIGN, NULL, NULL); | 1364 | SLAB_HWCACHE_ALIGN, NULL, NULL); |
@@ -1368,14 +1366,15 @@ int proto_register(struct proto *prot, int alloc_slab) | |||
1368 | if (prot->slab == NULL) { | 1366 | if (prot->slab == NULL) { |
1369 | printk(KERN_CRIT "%s: Can't create sock SLAB cache!\n", | 1367 | printk(KERN_CRIT "%s: Can't create sock SLAB cache!\n", |
1370 | prot->name); | 1368 | prot->name); |
1371 | goto out_unlock; | 1369 | goto out; |
1372 | } | 1370 | } |
1373 | } | 1371 | } |
1374 | 1372 | ||
1373 | write_lock(&proto_list_lock); | ||
1375 | list_add(&prot->node, &proto_list); | 1374 | list_add(&prot->node, &proto_list); |
1376 | rc = 0; | ||
1377 | out_unlock: | ||
1378 | write_unlock(&proto_list_lock); | 1375 | write_unlock(&proto_list_lock); |
1376 | rc = 0; | ||
1377 | out: | ||
1379 | return rc; | 1378 | return rc; |
1380 | } | 1379 | } |
1381 | 1380 | ||