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:
parent
2493c61ed5
commit
811eb344d5
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue