[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200517054638.10764-1-xyz.sun.ok@gmail.com>
Date: Sun, 17 May 2020 13:46:38 +0800
From: Xiangyang Zhang <xyz.sun.ok@...il.com>
To: manishc@...vell.com, GR-Linux-NIC-Dev@...vell.com
Cc: gregkh@...uxfoundation.org, netdev@...r.kernel.org,
devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org,
Xiangyang Zhang <xyz.sun.ok@...il.com>
Subject: [PATCH] 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@...il.com>
---
drivers/staging/qlge/qlge_main.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/staging/qlge/qlge_main.c b/drivers/staging/qlge/qlge_main.c
index a9163fb659d9..402edaeffe12 100644
--- a/drivers/staging/qlge/qlge_main.c
+++ b/drivers/staging/qlge/qlge_main.c
@@ -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);
if (status)
- return status;
+ goto lock_failed;
status = ql_wait_cfg(qdev, bit);
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);
exit:
ql_sem_unlock(qdev, SEM_ICB_MASK); /* does flush too */
+lock_failed:
dma_unmap_single(&qdev->pdev->dev, map, size, direction);
return status;
}
--
2.19.1
Powered by blists - more mailing lists