From: Tom Rix <trix@redhat.com>
To: hughd@google.com, akpm@linux-foundation.org, nathan@kernel.org,
ndesaulniers@google.com, willy@infradead.org
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
llvm@lists.linux.dev, Tom Rix <trix@redhat.com>
Subject: [PATCH] mm/shmem: restore setting of page variable
Date: Mon, 9 May 2022 08:32:32 -0400 [thread overview]
Message-ID: <20220509123232.3428667-1-trix@redhat.com> (raw)
The clang build fails with
mm/shmem.c:2337:8: error: variable 'page' is uninitialized when used here [-Werror,-Wuninitialized]
if (!page)
^~~~
In the commit listed in the fixes, there was a change to the
from
page = shmem_alloc_page(..);
to
page = &shmem_alloc_folio(..)->page;
But in this case, instead of replacing, the setting of page was
deleted. So restore page with its new api.
Fixes: b0bb08b2d5f3 ("mm/shmem: turn shmem_alloc_page() into shmem_alloc_folio()")
Signed-off-by: Tom Rix <trix@redhat.com>
---
mm/shmem.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/mm/shmem.c b/mm/shmem.c
index 7faaa61ff7fa..a2234f19b711 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -2334,6 +2334,7 @@ int shmem_mfill_atomic_pte(struct mm_struct *dst_mm,
if (!*pagep) {
ret = -ENOMEM;
+ page = &shmem_alloc_folio(gfp, info, pgoff)->page;
if (!page)
goto out_unacct_blocks;
--
2.27.0
next reply other threads:[~2022-05-09 12:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-09 12:32 Tom Rix [this message]
2022-05-09 18:03 ` Andrew Morton
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=20220509123232.3428667-1-trix@redhat.com \
--to=trix@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=hughd@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=llvm@lists.linux.dev \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=willy@infradead.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