]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ksmbd: use list_first_entry_or_null for opinfo_get_list()
authorNamjae Jeon <linkinjeon@kernel.org>
Tue, 20 May 2025 00:25:03 +0000 (09:25 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 4 Jun 2025 12:43:54 +0000 (14:43 +0200)
commit334da674b25fdb7a1a4d4b89dcd7795144fc7e11
treecdf52256ead17b6cfb86eea1fc7d2f9922b41a5a
parent4a72fa2f59874e6df3360c88bb5e992b7cbbfcc5
ksmbd: use list_first_entry_or_null for opinfo_get_list()

[ Upstream commit 10379171f346e6f61d30d9949500a8de4336444a ]

The list_first_entry() macro never returns NULL.  If the list is
empty then it returns an invalid pointer.  Use list_first_entry_or_null()
to check if the list is empty.

Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/r/202505080231.7OXwq4Te-lkp@intel.com/
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/smb/server/oplock.c