[openib-general] [PATCH 5/5] Hold the iwch device mutex around cxio_rdev_open().
Steve Wise
swise at opengridcomputing.com
Thu Feb 8 12:26:44 PST 2007
From: Steve Wise <swise at opengridcomputing.com>
Signed-off-by: Steve Wise <swise at opengridcomputing.com>
---
drivers/infiniband/hw/cxgb3/iwch.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/infiniband/hw/cxgb3/iwch.c b/drivers/infiniband/hw/cxgb3/iwch.c
index 0c95f2c..c353a9b 100644
--- a/drivers/infiniband/hw/cxgb3/iwch.c
+++ b/drivers/infiniband/hw/cxgb3/iwch.c
@@ -119,7 +119,10 @@ static void open_rnic_dev(struct t3cdev
rnicp->rdev.ulp = rnicp;
rnicp->rdev.t3cdev_p = tdev;
+ mutex_lock(&dev_mutex);
+
if (cxio_rdev_open(&rnicp->rdev)) {
+ mutex_unlock(&dev_mutex);
printk(KERN_ERR MOD "Unable to open CXIO rdev\n");
ib_dealloc_device(&rnicp->ibdev);
return;
@@ -127,7 +130,6 @@ static void open_rnic_dev(struct t3cdev
rnic_init(rnicp);
- mutex_lock(&dev_mutex);
list_add_tail(&rnicp->entry, &dev_list);
mutex_unlock(&dev_mutex);
More information about the general
mailing list