[Concept,14/14] linux: ext4l: Initialize len in ext4_ext_find_hole

Message ID 20251230205157.3383926-15-sjg@u-boot.org
State New
Headers
Series ext4l: Linux adaptation patches for ext4 write support |

Commit Message

Simon Glass Dec. 30, 2025, 8:51 p.m. UTC
  From: Simon Glass <simon.glass@canonical.com>

Initialize 'len' to 0 to silence a Clang warning about the potential use
of an uninitialised variable. The else branch calls BUG() which never
returns, but Clang cannot determine this.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
---

 fs/ext4l/extents.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

diff --git a/fs/ext4l/extents.c b/fs/ext4l/extents.c
index 7690f4075db..955f587426b 100644
--- a/fs/ext4l/extents.c
+++ b/fs/ext4l/extents.c
@@ -2252,7 +2252,7 @@  static ext4_lblk_t ext4_ext_find_hole(struct inode *inode,
 {
 	int depth = ext_depth(inode);
 	struct ext4_extent *ex;
-	ext4_lblk_t len;
+	ext4_lblk_t len = 0;
 
 	ex = path[depth].p_ext;
 	if (ex == NULL) {