Skip to contentSkip to conversation

mm-zswap-fix-error-pointer-free-in-zswap_cpu_comp_prepare.patch removed from -mm tree

merged mm-hotfixes-stable Andrew Morton 1 participant 1 message Jan 13 Stable branch

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm/zswap: fix error pointer free in zswap_cpu_comp_prepare()
has been removed from the -mm tree. Its filename was
mm-zswap-fix-error-pointer-free-in-zswap_cpu_comp_prepare.patch

This patch was dropped because it was merged into the mm-hotfixes-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Pavel Butsykin <[email protected]>
Subject: mm/zswap: fix error pointer free in zswap_cpu_comp_prepare()
Date: Wed, 31 Dec 2025 11:46:38 +0400

crypto_alloc_acomp_node() may return ERR_PTR(), but the fail path checks only for NULL and can pass an error pointer to crypto_free_acomp(). Use IS_ERR_OR_NULL() to only free valid acomp instances.

Fixes 779b9955f643 ("mm: zswap: move allocations during CPU init outside the lock")
Cc Johannes Weiner <[email protected]>
Cc Chengming Zhou <[email protected]>

---

 mm/zswap.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/zswap.c renamed from mm/zswap.c~mm-zswap-fix-error-pointer-free-in-zswap_cpu_comp_prepare +1 -1
@@ -787,7 +787,7 @@ static int zswap_cpu_comp_prepare(unsign
 	return 0;
 
 fail:
-	if (acomp)
+	if (!IS_ERR_OR_NULL(acomp))
 		crypto_free_acomp(acomp);
 	kfree(buffer);
 	return ret;

_

Patches currently in -mm which might be from [email protected] are