mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-23 02:51:47 +00:00
Merge branch 'slab/for-6.1/trivial' into slab/for-next
Additional cleanup by Chao Yu removing a BUG_ON() in create_unique_id().
This commit is contained in:
commit
0bdcef54a2
1 changed files with 6 additions and 3 deletions
|
@ -5751,7 +5751,7 @@ static inline struct kset *cache_kset(struct kmem_cache *s)
|
|||
return slab_kset;
|
||||
}
|
||||
|
||||
#define ID_STR_LENGTH 64
|
||||
#define ID_STR_LENGTH 32
|
||||
|
||||
/* Create a unique string id for a slab cache:
|
||||
*
|
||||
|
@ -5785,9 +5785,12 @@ static char *create_unique_id(struct kmem_cache *s)
|
|||
*p++ = 'A';
|
||||
if (p != name + 1)
|
||||
*p++ = '-';
|
||||
p += sprintf(p, "%07u", s->size);
|
||||
p += snprintf(p, ID_STR_LENGTH - (p - name), "%07u", s->size);
|
||||
|
||||
BUG_ON(p > name + ID_STR_LENGTH - 1);
|
||||
if (WARN_ON(p > name + ID_STR_LENGTH - 1)) {
|
||||
kfree(name);
|
||||
return ERR_PTR(-EINVAL);
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue