From: Kriish Sharma <kriish.sharma2006@gmail.com>
To: clm@fb.com, dsterba@suse.com
Cc: linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org,
skhan@linuxfoundation.org, david.hunter.linux@gmail.com,
Kriish Sharma <kriish.sharma2006@gmail.com>,
kernel test robot <lkp@intel.com>
Subject: [PATCH] btrfs: initialize folios to NULL in compress_file_range()
Date: Sun, 19 Oct 2025 08:36:47 +0000 [thread overview]
Message-ID: <20251019083647.2096733-1-kriish.sharma2006@gmail.com> (raw)
The variable 'folios' may be used uninitialized when jumping to cleanup
labels, triggering the following clang warning:
fs/btrfs/inode.c:874:6: warning: variable 'folios' is used uninitialized
whenever 'if' condition is true
Initialize 'folios' to NULL to ensure the cleanup path is safe and to
silence the compiler warning.
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202510171743.VQ6yA0Uu-lkp@intel.com/
Signed-off-by: Kriish Sharma <kriish.sharma2006@gmail.com>
---
fs/btrfs/inode.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index d726bcdacf6b..54903e17338f 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -862,7 +862,7 @@ static void compress_file_range(struct btrfs_work *work)
u64 actual_end;
u64 i_size;
int ret = 0;
- struct folio **folios;
+ struct folio **folios = NULL;
unsigned long nr_folios;
unsigned long total_compressed = 0;
unsigned long total_in = 0;
--
2.34.1
next reply other threads:[~2025-10-19 8:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-19 8:36 Kriish Sharma [this message]
2025-10-19 9:12 ` Qu Wenruo
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=20251019083647.2096733-1-kriish.sharma2006@gmail.com \
--to=kriish.sharma2006@gmail.com \
--cc=clm@fb.com \
--cc=david.hunter.linux@gmail.com \
--cc=dsterba@suse.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--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
all inboxes | Powered by JetHome®