We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0495e33 commit 7e9c323Copy full SHA for 7e9c323
mm/slub.c
@@ -5890,7 +5890,8 @@ static char *create_unique_id(struct kmem_cache *s)
5890
char *name = kmalloc(ID_STR_LENGTH, GFP_KERNEL);
5891
char *p = name;
5892
5893
- BUG_ON(!name);
+ if (!name)
5894
+ return ERR_PTR(-ENOMEM);
5895
5896
*p++ = ':';
5897
/*
@@ -5948,6 +5949,8 @@ static int sysfs_slab_add(struct kmem_cache *s)
5948
5949
* for the symlinks.
5950
*/
5951
name = create_unique_id(s);
5952
+ if (IS_ERR(name))
5953
+ return PTR_ERR(name);
5954
}
5955
5956
s->kobj.kset = kset;
0 commit comments