Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 184277
b: refs/heads/master
c: faf2342
h: refs/heads/master
i:
  184275: a0e6c06
v: v3
  • Loading branch information
Alexey Dobriyan authored and David S. Miller committed Feb 17, 2010
1 parent cd3c044 commit ced0a57
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8a5ce54562f296b1996813a413b0f2307ec9351a
refs/heads/master: faf234220fb79a05891477a75180e1d9f7ab4105
10 changes: 2 additions & 8 deletions trunk/net/core/sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -2228,13 +2228,10 @@ int proto_register(struct proto *prot, int alloc_slab)
}

if (prot->rsk_prot != NULL) {
static const char mask[] = "request_sock_%s";

prot->rsk_prot->slab_name = kmalloc(strlen(prot->name) + sizeof(mask) - 1, GFP_KERNEL);
prot->rsk_prot->slab_name = kasprintf(GFP_KERNEL, "request_sock_%s", prot->name);
if (prot->rsk_prot->slab_name == NULL)
goto out_free_sock_slab;

sprintf(prot->rsk_prot->slab_name, mask, prot->name);
prot->rsk_prot->slab = kmem_cache_create(prot->rsk_prot->slab_name,
prot->rsk_prot->obj_size, 0,
SLAB_HWCACHE_ALIGN, NULL);
Expand All @@ -2247,14 +2244,11 @@ int proto_register(struct proto *prot, int alloc_slab)
}

if (prot->twsk_prot != NULL) {
static const char mask[] = "tw_sock_%s";

prot->twsk_prot->twsk_slab_name = kmalloc(strlen(prot->name) + sizeof(mask) - 1, GFP_KERNEL);
prot->twsk_prot->twsk_slab_name = kasprintf(GFP_KERNEL, "tw_sock_%s", prot->name);

if (prot->twsk_prot->twsk_slab_name == NULL)
goto out_free_request_sock_slab;

sprintf(prot->twsk_prot->twsk_slab_name, mask, prot->name);
prot->twsk_prot->twsk_slab =
kmem_cache_create(prot->twsk_prot->twsk_slab_name,
prot->twsk_prot->twsk_obj_size,
Expand Down

0 comments on commit ced0a57

Please sign in to comment.