The patch titled Subject: resource-fix-resource-leak-in-get_free_mem_region-fix has been added to the -mm mm-nonmm-unstable branch. Its filename is resource-fix-resource-leak-in-get_free_mem_region-fix.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/resource-fix-resource-leak-in-get_free_mem_region-fix.patch This patch will later appear in the mm-nonmm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> Subject: resource-fix-resource-leak-in-get_free_mem_region-fix Date: Tue Mar 4 04:11:59 PM PST 2025 fix braceology Cc: Andriy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx> Cc: Bjorn Helgaas <bhelgaas@xxxxxxxxxx> Cc: Dan Wiliams <dan.j.williams@xxxxxxxxx> Cc: "Huang, Ying" <huang.ying.caritas@xxxxxxxxx> Cc: Ilpo Jarvinen <ilpo.jarvinen@xxxxxxxxxxxxxxx> Cc: Joanthan Cameron <Jonathan.Cameron@xxxxxxxxxx> Cc: Li Zhijian <lizhijian@xxxxxxxxxxx> Cc: Mika Westeberg <mika.westerberg@xxxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- kernel/resource.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) --- a/kernel/resource.c~resource-fix-resource-leak-in-get_free_mem_region-fix +++ a/kernel/resource.c @@ -1998,10 +1998,11 @@ get_free_mem_region(struct device *dev, if (flags & GFR_REQUEST_REGION) { free_resource(res); devres_free(dr); - } else if (dev) + } else if (dev) { devm_release_action(dev, remove_free_mem_region, res); - else + } else { free_resource(res); + } return ERR_PTR(-ERANGE); } _ Patches currently in -mm which might be from akpm@xxxxxxxxxxxxxxxxxxxx are nfs-fix-nfs_release_folio-to-not-deadlock-via-kcompactd-writeback-fix.patch userfaultfd-do-not-block-on-locking-a-large-folio-with-raised-refcount-fix.patch mm-vmscan-extract-calculated-pressure-balance-as-a-function-fix.patch mm-madvise-split-out-mmap-locking-operations-for-madvise-fix-checkpatch-fixes.patch mm-madvise-remove-redundant-mmap_lock-operations-from-process_madvise-fix.patch selftests-mm-print-some-details-when-uffd-stress-gets-bad-params-fix.patch mm-pgtable-convert-some-architectures-to-use-tlb_remove_ptdesc-v2-fix.patch mm-mremap-initial-refactor-of-move_vma-fix.patch mm-mremap-thread-state-through-move-page-table-operation-fix.patch mm-hugetlb-add-hugetlb_alloc_threads-cmdline-option-fix.patch lib-plistc-add-shortcut-for-plist_requeue-fix.patch scsi-lpfc-convert-timeouts-to-secs_to_jiffies-fix.patch signal-avoid-clearing-tif_sigpending-in-recalc_sigpending-if-unset-fix.patch resource-fix-resource-leak-in-get_free_mem_region-fix.patch