staging: qlge: unmap dma when lock failed

DMA not unmapped when lock failed, this patch fixed it.

Signed-off-by: Xiangyang Zhang <xyz.sun.ok@gmail.com>
Fixes: 4322c5bee8 ("qlge: Expand coverage of hw lock for config register.")
Link: https://lore.kernel.org/r/20200517054638.10764-1-xyz.sun.ok@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Xiangyang Zhang 2020-05-17 13:46:38 +08:00 committed by Greg Kroah-Hartman
parent 2493c61ed5
commit 811eb344d5
1 changed files with 2 additions and 1 deletions

View File

@ -227,7 +227,7 @@ int ql_write_cfg(struct ql_adapter *qdev, void *ptr, int size, u32 bit,
status = ql_sem_spinlock(qdev, SEM_ICB_MASK); status = ql_sem_spinlock(qdev, SEM_ICB_MASK);
if (status) if (status)
return status; goto lock_failed;
status = ql_wait_cfg(qdev, bit); status = ql_wait_cfg(qdev, bit);
if (status) { if (status) {
@ -249,6 +249,7 @@ int ql_write_cfg(struct ql_adapter *qdev, void *ptr, int size, u32 bit,
status = ql_wait_cfg(qdev, bit); status = ql_wait_cfg(qdev, bit);
exit: exit:
ql_sem_unlock(qdev, SEM_ICB_MASK); /* does flush too */ ql_sem_unlock(qdev, SEM_ICB_MASK); /* does flush too */
lock_failed:
dma_unmap_single(&qdev->pdev->dev, map, size, direction); dma_unmap_single(&qdev->pdev->dev, map, size, direction);
return status; return status;
} }