]> git.baikalelectronics.ru Git - kernel.git/commit
iw_cxgb4: Fix potential NULL dereference in c4iw_fill_res_cm_id_entry()
authorDan Carpenter <error27@gmail.com>
Tue, 14 Feb 2023 15:43:38 +0000 (18:43 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Mar 2023 08:33:39 +0000 (09:33 +0100)
commit8ac64928a7ac6ce00e46e5f064956f2db33a2317
tree4a28465d5d9cdf9dead033e0884d7967c9f520a6
parent0f82e4744085c5f23687e35dfe113b274e4ac52a
iw_cxgb4: Fix potential NULL dereference in c4iw_fill_res_cm_id_entry()

[ Upstream commit 7553d77da3cfb243c48959af23de8d238733ec34 ]

This condition needs to match the previous "if (epcp->state == LISTEN) {"
exactly to avoid a NULL dereference of either "listen_ep" or "ep". The
problem is that "epcp" has been re-assigned so just testing
"if (epcp->state == LISTEN) {" a second time is not sufficient.

Fixes: f5ab704905b0 ("iw_cxgb4: provide detailed provider-specific CM_ID information")
Signed-off-by: Dan Carpenter <error27@gmail.com>
Link: https://lore.kernel.org/r/Y+usKuWIKr4dimZh@kili
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/infiniband/hw/cxgb4/restrack.c