diff --git a/mm/huge_memory.c b/mm/huge_memory.c index c615e81620b9..c61871b5a333 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -818,10 +818,8 @@ static struct thpsize *thpsize_create(int order, struct kobject *parent) ret = kobject_init_and_add(&thpsize->kobj, &thpsize_ktype, parent, "hugepages-%lukB", size); - if (ret) { - kfree(thpsize); - goto err; - } + if (ret) + goto err_put; ret = sysfs_add_group(&thpsize->kobj, &any_ctrl_attr_grp);