Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 123458
b: refs/heads/master
c: 7b8f3b6
h: refs/heads/master
v: v3
  • Loading branch information
David Rientjes authored and Pekka Enberg committed Dec 29, 2008
1 parent c546dcd commit 6e2258b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 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: dfcd3610289132a762b7dc0eaf33998262cd9e20
refs/heads/master: 7b8f3b66d9d7e5f021ae535620b9b52833f4876e
13 changes: 11 additions & 2 deletions trunk/mm/slub.c
Original file line number Diff line number Diff line change
Expand Up @@ -3124,8 +3124,12 @@ struct kmem_cache *kmem_cache_create(const char *name, size_t size,
s->inuse = max_t(int, s->inuse, ALIGN(size, sizeof(void *)));
up_write(&slub_lock);

if (sysfs_slab_alias(s, name))
if (sysfs_slab_alias(s, name)) {
down_write(&slub_lock);
s->refcount--;
up_write(&slub_lock);
goto err;
}
return s;
}

Expand All @@ -3135,8 +3139,13 @@ struct kmem_cache *kmem_cache_create(const char *name, size_t size,
size, align, flags, ctor)) {
list_add(&s->list, &slab_caches);
up_write(&slub_lock);
if (sysfs_slab_add(s))
if (sysfs_slab_add(s)) {
down_write(&slub_lock);
list_del(&s->list);
up_write(&slub_lock);
kfree(s);
goto err;
}
return s;
}
kfree(s);
Expand Down

0 comments on commit 6e2258b

Please sign in to comment.