From: Gautam Menghani <gautammenghani201@gmail.com>
To: akpm@linux-foundation.org
Cc: Gautam Menghani <gautammenghani201@gmail.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
linux-kernel-mentees@lists.linuxfoundation.org,
skhan@linuxfoundation.org
Subject: [PATCH] include/linux/mm: Initialize an int variable to prevent returning garbage value
Date: Tue, 24 May 2022 10:27:55 -0700 [thread overview]
Message-ID: <20220524172755.11892-1-gautammenghani201@gmail.com> (raw)
Initialize the variable 'ret' to prevent garbage value from being
returned. This Fixes the clang scan warning: Undefined or garbage value
returned to caller [core.uninitialized.UndefReturn]
return ret;
Signed-off-by: Gautam Menghani <gautammenghani201@gmail.com>
---
include/linux/mm.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 9f44254af8ce..f437bd81d6a4 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -1700,7 +1700,7 @@ static inline int arch_make_page_accessible(struct page *page)
#ifndef HAVE_ARCH_MAKE_FOLIO_ACCESSIBLE
static inline int arch_make_folio_accessible(struct folio *folio)
{
- int ret;
+ int ret = 0;
long i, nr = folio_nr_pages(folio);
for (i = 0; i < nr; i++) {
--
2.25.1
reply other threads:[~2022-05-24 17:28 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=20220524172755.11892-1-gautammenghani201@gmail.com \
--to=gautammenghani201@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel-mentees@lists.linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=skhan@linuxfoundation.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;
as well as URLs for NNTP newsgroup(s).