diff options
author | Zhen Lei <thunder.leizhen@huawei.com> | 2024-10-09 11:54:55 +0800 |
---|---|---|
committer | Vlastimil Babka <vbabka@suse.cz> | 2024-10-29 10:43:24 +0100 |
commit | b4b797d87745f79e1d3c945dc0db4093c9ae9904 (patch) | |
tree | 24d3898fbb0b8d014da1b9378abbf94761b111e9 /mm | |
parent | 1e4df1859ec2d09fdfe184e7a92a476f01f64e34 (diff) | |
download | linux-stable-b4b797d87745f79e1d3c945dc0db4093c9ae9904.tar.gz linux-stable-b4b797d87745f79e1d3c945dc0db4093c9ae9904.tar.bz2 linux-stable-b4b797d87745f79e1d3c945dc0db4093c9ae9904.zip |
mm/slab: remove duplicate check in create_cache()
The WARN_ON() check in static function create_cache() is done by its only
parent __kmem_cache_create_args() before calling it.
if (... ||
WARN_ON(... ||
object_size - args->usersize < args->useroffset))
args->usersize = args->useroffset = 0;
...
s = create_cache(cache_name, object_size, args, flags);
Therefore, the WARN_ON() check in create_cache() can be safely removed.
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/slab_common.c | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/mm/slab_common.c b/mm/slab_common.c index f1f90491df03..9e22d1266f6a 100644 --- a/mm/slab_common.c +++ b/mm/slab_common.c @@ -222,9 +222,6 @@ static struct kmem_cache *create_cache(const char *name, struct kmem_cache *s; int err; - if (WARN_ON(args->useroffset + args->usersize > object_size)) - args->useroffset = args->usersize = 0; - /* If a custom freelist pointer is requested make sure it's sane. */ err = -EINVAL; if (args->use_freeptr_offset && |