]> git.baikalelectronics.ru Git - kernel.git/commit
net/tls: tls_is_tx_ready() checked list_entry
authorPietro Borrello <borrello@diag.uniroma1.it>
Sat, 28 Jan 2023 16:29:17 +0000 (16:29 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Feb 2023 10:28:08 +0000 (11:28 +0100)
commit5dd2ab2e02df14b3919d2f683f3f07b0c15ea00f
treeec6c6f0c173e58527cef1e9902c503b1f316c395
parent0088076eb7539ee6230f68c08087ebde3a1f3cb8
net/tls: tls_is_tx_ready() checked list_entry

[ Upstream commit ffe2a22562444720b05bdfeb999c03e810d84cbb ]

tls_is_tx_ready() checks that list_first_entry() does not return NULL.
This condition can never happen. For empty lists, list_first_entry()
returns the list_entry() of the head, which is a type confusion.
Use list_first_entry_or_null() which returns NULL in case of empty
lists.

Fixes: 4e09428b5ad7 ("net/tls: Add support for async encryption of records for performance")
Signed-off-by: Pietro Borrello <borrello@diag.uniroma1.it>
Link: https://lore.kernel.org/r/20230128-list-entry-null-check-tls-v1-1-525bbfe6f0d0@diag.uniroma1.it
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/tls/tls_sw.c