WSL2-Linux-Kernel/drivers/crypto/stm32
Thomas Bourgoin 556be726a4 crypto: stm32/crc32 - fix parsing list of devices
[ Upstream commit 0eaef675b94c746900dcea7f6c41b9a103ed5d53 ]

smatch warnings:
drivers/crypto/stm32/stm32-crc32.c:108 stm32_crc_get_next_crc() warn:
can 'crc' even be NULL?

Use list_first_entry_or_null instead of list_first_entry to retrieve
the first device registered.
The function list_first_entry always return a non NULL pointer even if
the list is empty. Hence checking if the pointer returned is NULL does
not tell if the list is empty or not.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/r/202311281111.ou2oUL2i-lkp@intel.com/
Reported-by: Dan Carpenter <error27@gmail.com>
Closes: https://lore.kernel.org/r/202311281111.ou2oUL2i-lkp@intel.com/
Signed-off-by: Thomas Bourgoin <thomas.bourgoin@foss.st.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-02-23 08:54:39 +01:00
..
Kconfig crypto: stm32/crc32 - Avoid lock if hardware is already used 2020-09-25 17:48:14 +10:00
Makefile Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2019-07-08 20:57:08 -07:00
stm32-crc32.c crypto: stm32/crc32 - fix parsing list of devices 2024-02-23 08:54:39 +01:00
stm32-cryp.c crypto: stm32 - Revert broken pm_runtime_resume_and_get changes 2022-01-27 11:03:35 +01:00
stm32-hash.c crypto: stm32 - fix loop iterating through scatterlist for DMA 2023-09-19 12:22:52 +02:00