Commit daac9681 authored by Devesh Sharma's avatar Devesh Sharma Committed by Roland Dreier

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: default avatarDevesh Sharma <devesh.sharma@emulex.com>
Signed-off-by: default avatarSelvin Xavier <selvin.xavier@emulex.com>
Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
parent a53d77a3
...@@ -1505,6 +1505,7 @@ static void ocrdma_mbx_delete_ah_tbl(struct ocrdma_dev *dev) ...@@ -1505,6 +1505,7 @@ static void ocrdma_mbx_delete_ah_tbl(struct ocrdma_dev *dev)
ocrdma_mbx_cmd(dev, (struct ocrdma_mqe *)cmd); ocrdma_mbx_cmd(dev, (struct ocrdma_mqe *)cmd);
dma_free_coherent(&pdev->dev, dev->av_tbl.size, dev->av_tbl.va, dma_free_coherent(&pdev->dev, dev->av_tbl.size, dev->av_tbl.va,
dev->av_tbl.pa); dev->av_tbl.pa);
dev->av_tbl.va = NULL;
dma_free_coherent(&pdev->dev, PAGE_SIZE, dev->av_tbl.pbl.va, dma_free_coherent(&pdev->dev, PAGE_SIZE, dev->av_tbl.pbl.va,
dev->av_tbl.pbl.pa); dev->av_tbl.pbl.pa);
kfree(cmd); kfree(cmd);
...@@ -2882,13 +2883,15 @@ int ocrdma_init_hw(struct ocrdma_dev *dev) ...@@ -2882,13 +2883,15 @@ int ocrdma_init_hw(struct ocrdma_dev *dev)
goto conf_err; goto conf_err;
status = ocrdma_mbx_get_phy_info(dev); status = ocrdma_mbx_get_phy_info(dev);
if (status) if (status)
goto conf_err; goto info_attrb_err;
status = ocrdma_mbx_get_ctrl_attribs(dev); status = ocrdma_mbx_get_ctrl_attribs(dev);
if (status) if (status)
goto conf_err; goto info_attrb_err;
return 0; return 0;
info_attrb_err:
ocrdma_mbx_delete_ah_tbl(dev);
conf_err: conf_err:
ocrdma_destroy_mq(dev); ocrdma_destroy_mq(dev);
mq_err: mq_err:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment