public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] RDMA/bng_re: Fix CREQ BAR base validity check in bng_re_map_creq_db
@ 2026-02-27 15:35 Alok Tiwari
  2026-03-02 10:22 ` Siva Reddy Kallam
  2026-03-04  9:52 ` Leon Romanovsky
  0 siblings, 2 replies; 3+ messages in thread
From: Alok Tiwari @ 2026-02-27 15:35 UTC (permalink / raw)
  To: usman.ansari, siva.kallam, leon, jgg, kalesh-anakkur.purayil,
	vikas.gupta, bhargava.marreddy, linux-rdma
  Cc: alok.a.tiwarilinux, alok.a.tiwari

bng_re_map_creq_db() initializes creq_db->reg.bar_id to the fixed BAR
index used for the CREQ doorbell, then reads the BAR start address via
pci_resource_start().

The existing code checked !bar_id, which is not a validity test for the
PCI resource start. Check !bar_base instead and log an error when the
BAR start address is 0.

Fixes: 4f830cd8d7fe ("RDMA/bng_re: Add infrastructure for enabling Firmware channel")
Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
---
 drivers/infiniband/hw/bng_re/bng_fw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/bng_re/bng_fw.c b/drivers/infiniband/hw/bng_re/bng_fw.c
index 17d7cc3aa11d..92e7fa4dcf1a 100644
--- a/drivers/infiniband/hw/bng_re/bng_fw.c
+++ b/drivers/infiniband/hw/bng_re/bng_fw.c
@@ -581,7 +581,7 @@ static int bng_re_map_creq_db(struct bng_re_rcfw *rcfw, u32 reg_offt)
 	creq_db->dbinfo.flags = 0;
 	creq_db->reg.bar_id = BNG_FW_COMM_CONS_PCI_BAR_REGION;
 	creq_db->reg.bar_base = pci_resource_start(pdev, creq_db->reg.bar_id);
-	if (!creq_db->reg.bar_id)
+	if (!creq_db->reg.bar_base)
 		dev_err(&pdev->dev,
 			"CREQ BAR region %d resc start is 0!",
 			creq_db->reg.bar_id);
-- 
2.50.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-03-04  9:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-27 15:35 [PATCH] RDMA/bng_re: Fix CREQ BAR base validity check in bng_re_map_creq_db Alok Tiwari
2026-03-02 10:22 ` Siva Reddy Kallam
2026-03-04  9:52 ` Leon Romanovsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox