From: Namjae Jeon Date: Fri, 10 Apr 2026 15:02:49 +0000 (+0900) Subject: ntfs: fix uninitialized variables in ntfs_ea_set_wsl_inode() X-Git-Tag: v7.1-rc1~14^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cd8d29c1b3c3397493115a9e919a806ea28aef05;p=thirdparty%2Fkernel%2Flinux.git ntfs: fix uninitialized variables in ntfs_ea_set_wsl_inode() Smatch reported uninitialized symbol warnings in ntfs_ea_set_wsl_inode() and __ntfs_create(). In ntfs_ea_set_wsl_inode(), the err variable could be returned without initialization if no flags are set and rdev is zero. Additionally, ea_size might remain uninitialized from the caller's perspective if no EA operations are performed. While these cases might not be triggered under current logic, we initialize them to zero to satisfy the static checker. Reported-by: Dan Carpenter Reviewed-by: Hyunchul Lee Signed-off-by: Namjae Jeon --- diff --git a/fs/ntfs/ea.c b/fs/ntfs/ea.c index ee99baf9c7d2..c4a4a3e3e599 100644 --- a/fs/ntfs/ea.c +++ b/fs/ntfs/ea.c @@ -406,7 +406,10 @@ int ntfs_ea_set_wsl_inode(struct inode *inode, dev_t rdev, __le16 *ea_size, unsigned int flags) { __le32 v; - int err; + int err = 0; + + if (ea_size) + *ea_size = 0; if (flags & NTFS_EA_UID) { /* Store uid to lxuid EA */