Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <error27@gmail.com>
Reviewed-by: Hyunchul Lee <hyc.lee@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>

+4 -1
+4 -1
fs/ntfs/ea.c
··· 406 406 unsigned int flags) 407 407 { 408 408 __le32 v; 409 - int err; 409 + int err = 0; 410 + 411 + if (ea_size) 412 + *ea_size = 0; 410 413 411 414 if (flags & NTFS_EA_UID) { 412 415 /* Store uid to lxuid EA */