[openib-general] [PATCH] mthca: check return value in mthca_dev_lim call

Jack Morgenstein jackm at mellanox.co.il
Mon Dec 19 04:00:49 PST 2005


Check error return on call to mthca_dev_lim for Tavor (as is done for memfree).

Signed-off-by: Jack Morgenstein <jackm at mellanox.co.il>

Index: linux-kernel/drivers/infiniband/hw/mthca/mthca_main.c
===================================================================
--- linux-kernel.orig/drivers/infiniband/hw/mthca/mthca_main.c
+++ linux-kernel/drivers/infiniband/hw/mthca/mthca_main.c
@@ -261,6 +261,10 @@ static int __devinit mthca_init_tavor(st
 	}
 
 	err = mthca_dev_lim(mdev, &dev_lim);
+	if (err) {
+		mthca_err(mdev, "QUERY_DEV_LIM command failed, aborting.\n");
+		goto err_disable;
+	}
 
 	profile = default_profile;
 	profile.num_uar   = dev_lim.uar_size / PAGE_SIZE;



More information about the general mailing list