summaryrefslogtreecommitdiff
path: root/mm/shrinker.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-11-05 09:55:37 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-11-05 09:56:08 +0100
commit85c4efbe608887cbce675fad3288172046f74713 (patch)
tree42aa0a76ec945920d04344a6c2a7f7c86d054c28 /mm/shrinker.c
parentbf373d2919d98f3d1fe1b19a0304f72fe74386d9 (diff)
parent59b723cd2adbac2a34fc8e12c74ae26ae45bf230 (diff)
downloadlwn-85c4efbe608887cbce675fad3288172046f74713.tar.gz
lwn-85c4efbe608887cbce675fad3288172046f74713.zip
Merge v6.12-rc6 into usb-next
We need the USB fixes in here as well, and this resolves a merge conflict in: drivers/usb/typec/tcpm/tcpm.c Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Link: https://lore.kernel.org/r/20241101150730.090dc30f@canb.auug.org.au Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'mm/shrinker.c')
-rw-r--r--mm/shrinker.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/mm/shrinker.c b/mm/shrinker.c
index dc5d2a6fcfc4..4a93fd433689 100644
--- a/mm/shrinker.c
+++ b/mm/shrinker.c
@@ -76,19 +76,21 @@ void free_shrinker_info(struct mem_cgroup *memcg)
int alloc_shrinker_info(struct mem_cgroup *memcg)
{
- struct shrinker_info *info;
int nid, ret = 0;
int array_size = 0;
mutex_lock(&shrinker_mutex);
array_size = shrinker_unit_size(shrinker_nr_max);
for_each_node(nid) {
- info = kvzalloc_node(sizeof(*info) + array_size, GFP_KERNEL, nid);
+ struct shrinker_info *info = kvzalloc_node(sizeof(*info) + array_size,
+ GFP_KERNEL, nid);
if (!info)
goto err;
info->map_nr_max = shrinker_nr_max;
- if (shrinker_unit_alloc(info, NULL, nid))
+ if (shrinker_unit_alloc(info, NULL, nid)) {
+ kvfree(info);
goto err;
+ }
rcu_assign_pointer(memcg->nodeinfo[nid]->shrinker_info, info);
}
mutex_unlock(&shrinker_mutex);