futex: Move futex cleanup to __mmdrop()

Futex hash allocations are done in mm_init() and the cleanup happens in
__mmput(). That works most of the time, but there are mm instances which
are instantiated via mm_alloc() and freed via mmdrop(), which causes the
futex hash to be leaked.

Move the cleanup to __mmdrop().

Fixes: 56180dd20c19 ("futex: Use RCU-based per-CPU reference counting instead of rcuref_t")
Reported-by: André Draszik <andre.draszik@linaro.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: André Draszik <andre.draszik@linaro.org>
Link: https://lore.kernel.org/all/87ldo5ihu0.ffs@tglx
Closes: https://lore.kernel.org/all/0c8cc83bb73abf080faf584f319008b67d0931db.camel@linaro.org

Changed files
+1 -1
kernel
+1 -1
kernel/fork.c
··· 686 686 mm_pasid_drop(mm); 687 687 mm_destroy_cid(mm); 688 688 percpu_counter_destroy_many(mm->rss_stat, NR_MM_COUNTERS); 689 + futex_hash_free(mm); 689 690 690 691 free_mm(mm); 691 692 } ··· 1134 1133 if (mm->binfmt) 1135 1134 module_put(mm->binfmt->module); 1136 1135 lru_gen_del_mm(mm); 1137 - futex_hash_free(mm); 1138 1136 mmdrop(mm); 1139 1137 } 1140 1138