]> git.ipfire.org Git - thirdparty/linux.git/commit
ntfs: fix variable dereferenced before check ni and attr in ntfs_attrlist_entry_add()
authorNamjae Jeon <linkinjeon@kernel.org>
Fri, 1 May 2026 12:10:38 +0000 (21:10 +0900)
committerNamjae Jeon <linkinjeon@kernel.org>
Sun, 3 May 2026 01:40:09 +0000 (10:40 +0900)
commitd3894e4e09085bc6450aae6e3d30d13f1b1c8691
tree37c7c45caa23a4a0201c39a3463c890b032485ce
parent66edb901bf874d9e0787326ba12d3548b2da8700
ntfs: fix variable dereferenced before check ni and attr in ntfs_attrlist_entry_add()

Smatch warnings:

ntfs_attrlist_entry_add() warn: variable dereferenced before check 'ni'
ntfs_attrlist_entry_add() warn: variable dereferenced before check 'attr'

Moves the ntfs_debug() call after the NULL pointer checks to ensure safe
access to the structure members.

Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
fs/ntfs/attrlist.c