From: Andrew Morton <akpm@linux-foundation.org>
To: mm-commits@vger.kernel.org,yosry@kernel.org,nphamcs@gmail.com,
hannes@cmpxchg.org,chengming.zhou@linux.dev,zhangchujun@cmss.chinamobile.com,
akpm@linux-foundation.org
Subject: + selftests-cgroup-test_zswap-check-malloc-return-value.patch added to mm-unstable branch
Date: Mon, 09 Nov 2026 22:08:21 -0800 [thread overview]
Message-ID: <20261110060821.705B31F0089F@smtp.kernel.org> (raw)
The patch titled
Subject: selftests/cgroup: test_zswap: check malloc() return value
has been added to the -mm mm-unstable branch. Its filename is
selftests-cgroup-test_zswap-check-malloc-return-value.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/selftests-cgroup-test_zswap-check-malloc-return-value.patch
This patch will later appear in the mm-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 various
branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there most days
------------------------------------------------------
From: zhangchujun <zhangchujun@cmss.chinamobile.com>
Subject: selftests/cgroup: test_zswap: check malloc() return value
Date: Wed, 04 Nov 2026 17:53:15 +0800
test_no_invasive_cgroup_shrink() uses zw_allocation immediately after
malloc() without checking for allocation failure.
Check for NULL before accessing the buffer and use the existing cleanup
path to report test failure, matching the handling of wb_allocation later
in the function.
Link: https://lore.kernel.org/20261104095315.2326-1-zhangchujun@cmss.chinamobile.com
Signed-off-by: zhangchujun <zhangchujun@cmss.chinamobile.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Nhat Pham <nphamcs@gmail.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Yosry Ahmed <yosry@kernel.org>
Cc: Chengming Zhou <chengming.zhou@linux.dev>
---
tools/testing/selftests/cgroup/test_zswap.c | 2 ++
1 file changed, 2 insertions(+)
--- a/tools/testing/selftests/cgroup/test_zswap.c~selftests-cgroup-test_zswap-check-malloc-return-value
+++ a/tools/testing/selftests/cgroup/test_zswap.c
@@ -503,6 +503,8 @@ static int test_no_invasive_cgroup_shrin
if (cg_enter_current(zw_group))
goto out;
zw_allocation = malloc(allocation_size);
+ if (!zw_allocation)
+ goto out;
for (int i = 0; i < nr_pages; i++) {
off = (unsigned long)i * page_size;
memset(&zw_allocation[off], 0, page_size);
_
Patches currently in -mm which might be from zhangchujun@cmss.chinamobile.com are
mm-page_owner-use-%u-to-print-the-stack-depot-handle.patch
selftests-cgroup-test_zswap-check-malloc-return-value.patch
reply other threads:[~2026-11-10 6:08 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261110060821.705B31F0089F@smtp.kernel.org \
--to=akpm@linux-foundation.org \
--cc=chengming.zhou@linux.dev \
--cc=hannes@cmpxchg.org \
--cc=mm-commits@vger.kernel.org \
--cc=nphamcs@gmail.com \
--cc=yosry@kernel.org \
--cc=zhangchujun@cmss.chinamobile.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.