From: Andrew Morton <akpm@linux-foundation.org>
To: mm-commits@vger.kernel.org,shuah@kernel.org,eva.kurchatova@virtuozzo.com,aris@redhat.com,khorenko@virtuozzo.com,akpm@linux-foundation.org
Subject: [merged mm-stable] selftests-memfd-fix-wmaybe-uninitialized-warning-in-memfd_test.patch removed from -mm tree
Date: Tue, 02 Jun 2026 15:26:46 -0700 [thread overview]
Message-ID: <20260602222646.DF92D1F00893@smtp.kernel.org> (raw)
The quilt patch titled
Subject: selftests/memfd: fix -Wmaybe-uninitialized warning in memfd_test
has been removed from the -mm tree. Its filename was
selftests-memfd-fix-wmaybe-uninitialized-warning-in-memfd_test.patch
This patch was dropped because it was merged into the mm-stable branch
of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
------------------------------------------------------
From: Konstantin Khorenko <khorenko@virtuozzo.com>
Subject: selftests/memfd: fix -Wmaybe-uninitialized warning in memfd_test
Date: Sun, 24 May 2026 22:35:56 +0300
Patch series "selftests/memfd: fix compilation warnings".
This patchset fixes warnings about unused but initialized variables, and
unused dummy buffer passed to pwrite() syscall in the tests.
This patch (of 2):
memfd_test.c: In function 'mfd_fail_grow_write.part.0':
memfd_test.c:685:13: warning: '<unknown>' may be used uninitialized
[-Wmaybe-uninitialized]
685 | l = pwrite(fd, buf, mfd_def_size * 8, 0);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pwrite() is declared with attribute 'access (read_only, 2, 3)', so GCC
knows it reads from the buffer. malloc() returns uninitialized memory,
hence the warning. Use calloc() to zero-initialize the buffer. The
actual contents don't matter here since the test verifies that pwrite()
fails on a sealed memfd.
Link: https://lore.kernel.org/20260524193732.48853-1-eva.kurchatova@virtuozzo.com
Link: https://lore.kernel.org/20260524193732.48853-2-eva.kurchatova@virtuozzo.com
Signed-off-by: Konstantin Khorenko <khorenko@virtuozzo.com>
Signed-off-by: Eva Kurchatova <eva.kurchatova@virtuozzo.com>
Cc: Aristeu Rozanski <aris@redhat.com>
Cc: Shuah Khan <shuah@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
tools/testing/selftests/memfd/memfd_test.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/tools/testing/selftests/memfd/memfd_test.c~selftests-memfd-fix-wmaybe-uninitialized-warning-in-memfd_test
+++ a/tools/testing/selftests/memfd/memfd_test.c
@@ -688,9 +688,9 @@ static void mfd_assert_grow_write(int fd
if (hugetlbfs_test)
return;
- buf = malloc(mfd_def_size * 8);
+ buf = calloc(1, mfd_def_size * 8);
if (!buf) {
- printf("malloc(%zu) failed: %m\n", mfd_def_size * 8);
+ printf("calloc(1, %zu) failed: %m\n", mfd_def_size * 8);
abort();
}
_
Patches currently in -mm which might be from khorenko@virtuozzo.com are
reply other threads:[~2026-06-02 22:26 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=20260602222646.DF92D1F00893@smtp.kernel.org \
--to=akpm@linux-foundation.org \
--cc=aris@redhat.com \
--cc=eva.kurchatova@virtuozzo.com \
--cc=khorenko@virtuozzo.com \
--cc=mm-commits@vger.kernel.org \
--cc=shuah@kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox