summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorDevesh Sharma <devesh.sharma@emulex.com>2014-06-10 19:32:18 +0530
committerRoland Dreier <roland@purestorage.com>2014-08-01 15:07:36 -0700
commitdaac96815e969bd70ed5ad21231be2fc5d99506d (patch)
treeae8be3dbd44ff031e071d4caa9f0df7d757d38ce /drivers/infiniband
parenta53d77a33494a3d1d5c797df311c975a05d69ef3 (diff)
downloadop-kernel-dev-daac96815e969bd70ed5ad21231be2fc5d99506d.zip
op-kernel-dev-daac96815e969bd70ed5ad21231be2fc5d99506d.tar.gz
RDMA/ocrdma: Delete AH table if ocrdma_init_hw fails after AH table creation
Cleanup the AH table in error path, if HW initialization fails after AH table creation. Signed-off-by: Devesh Sharma <devesh.sharma@emulex.com> Signed-off-by: Selvin Xavier <selvin.xavier@emulex.com> Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/hw/ocrdma/ocrdma_hw.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_hw.c b/drivers/infiniband/hw/ocrdma/ocrdma_hw.c
index e6463cb..55308b6 100644
--- a/drivers/infiniband/hw/ocrdma/ocrdma_hw.c
+++ b/drivers/infiniband/hw/ocrdma/ocrdma_hw.c
@@ -1505,6 +1505,7 @@ static void ocrdma_mbx_delete_ah_tbl(struct ocrdma_dev *dev)
ocrdma_mbx_cmd(dev, (struct ocrdma_mqe *)cmd);
dma_free_coherent(&pdev->dev, dev->av_tbl.size, dev->av_tbl.va,
dev->av_tbl.pa);
+ dev->av_tbl.va = NULL;
dma_free_coherent(&pdev->dev, PAGE_SIZE, dev->av_tbl.pbl.va,
dev->av_tbl.pbl.pa);
kfree(cmd);
@@ -2882,13 +2883,15 @@ int ocrdma_init_hw(struct ocrdma_dev *dev)
goto conf_err;
status = ocrdma_mbx_get_phy_info(dev);
if (status)
- goto conf_err;
+ goto info_attrb_err;
status = ocrdma_mbx_get_ctrl_attribs(dev);
if (status)
- goto conf_err;
+ goto info_attrb_err;
return 0;
+info_attrb_err:
+ ocrdma_mbx_delete_ah_tbl(dev);
conf_err:
ocrdma_destroy_mq(dev);
mq_err:
OpenPOWER on IntegriCloud