summaryrefslogtreecommitdiff
path: root/drivers/staging/rdma
diff options
context:
space:
mode:
authorHarish Chegondi <harish.chegondi@intel.com>2015-12-01 20:38:20 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-12-21 21:51:55 (GMT)
commite8597eb01456f11f978f316c41ea54c935eb2f50 (patch)
treeee07a43fc5748458eac35aad733bb2ebf34ca012 /drivers/staging/rdma
parent2c5b521ae688a6943d79e3f1210502084b375ced (diff)
downloadlinux-e8597eb01456f11f978f316c41ea54c935eb2f50.tar.xz
staging/rdma/hfi1: Destroy workqueues if hfi1_register_ib_device() call returns error
Currently, if hfi1_register_ib_device() call is unsuccessful, workqueues are not being destroyed before bailing out. This patch fixes this issue. Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com> Signed-off-by: Harish Chegondi <harish.chegondi@intel.com> Signed-off-by: Jubin John <jubin.john@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rdma')
-rw-r--r--drivers/staging/rdma/hfi1/init.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/staging/rdma/hfi1/init.c b/drivers/staging/rdma/hfi1/init.c
index 52fa86f..2d52f91 100644
--- a/drivers/staging/rdma/hfi1/init.c
+++ b/drivers/staging/rdma/hfi1/init.c
@@ -1336,6 +1336,7 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
{
int ret = 0, j, pidx, initfail;
struct hfi1_devdata *dd = NULL;
+ struct hfi1_pportdata *ppd;
/* First, lock the non-writable module parameters */
HFI1_CAP_LOCK();
@@ -1431,8 +1432,14 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
if (initfail || ret) {
stop_timers(dd);
flush_workqueue(ib_wq);
- for (pidx = 0; pidx < dd->num_pports; ++pidx)
+ for (pidx = 0; pidx < dd->num_pports; ++pidx) {
hfi1_quiet_serdes(dd->pport + pidx);
+ ppd = dd->pport + pidx;
+ if (ppd->hfi1_wq) {
+ destroy_workqueue(ppd->hfi1_wq);
+ ppd->hfi1_wq = NULL;
+ }
+ }
if (!j)
hfi1_device_remove(dd);
if (!ret)