]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
RDMA/bnxt_re: Fix incorrect BAR check in bnxt_qplib_map_creq_db()
authorAlok Tiwari <alok.a.tiwari@oracle.com>
Wed, 17 Dec 2025 10:01:41 +0000 (02:01 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Jan 2026 12:11:55 +0000 (13:11 +0100)
commit841320d3cf6ede9b856e4bcaa89c6dd2af4fb5d7
tree29e667707400b4b1d4549783f02600f925c172f4
parent38bd0305dcb65c6c143063625d3d247a14cb1162
RDMA/bnxt_re: Fix incorrect BAR check in bnxt_qplib_map_creq_db()

[ Upstream commit 145a417a39d7efbc881f52e829817376972b278c ]

RCFW_COMM_CONS_PCI_BAR_REGION is defined as BAR 2, so checking
!creq_db->reg.bar_id is incorrect and always false.

pci_resource_start() returns the BAR base address, and a value of 0
indicates that the BAR is unassigned. Update the condition to test
bar_base == 0 instead.

This ensures the driver detects and logs an error for an unassigned
RCFW communication BAR.

Fixes: cee0c7bba486 ("RDMA/bnxt_re: Refactor command queue management code")
Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
Link: https://patch.msgid.link/20251217100158.752504-1-alok.a.tiwari@oracle.com
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/infiniband/hw/bnxt_re/qplib_rcfw.c