DriverDev-Devel Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] staging: qlge: unmap dma when lock failed
@ 2020-05-17  5:46 Xiangyang Zhang
  2020-05-18  4:54 ` Benjamin Poirier
  0 siblings, 1 reply; 2+ messages in thread
From: Xiangyang Zhang @ 2020-05-17  5:46 UTC (permalink / raw)
  To: manishc, GR-Linux-NIC-Dev
  Cc: devel, gregkh, Xiangyang Zhang, linux-kernel, netdev

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

Signed-off-by: Xiangyang Zhang <xyz.sun.ok@gmail.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

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] staging: qlge: unmap dma when lock failed
  2020-05-17  5:46 [PATCH] staging: qlge: unmap dma when lock failed Xiangyang Zhang
@ 2020-05-18  4:54 ` Benjamin Poirier
  0 siblings, 0 replies; 2+ messages in thread
From: Benjamin Poirier @ 2020-05-18  4:54 UTC (permalink / raw)
  To: Xiangyang Zhang
  Cc: devel, GR-Linux-NIC-Dev, manishc, gregkh, linux-kernel, netdev

On 2020-05-17 13:46 +0800, Xiangyang Zhang wrote:
> DMA not unmapped when lock failed, this patch fixed it.
> 

Fixes: 4322c5bee85e ("qlge: Expand coverage of hw lock for config register.")

> Signed-off-by: Xiangyang Zhang <xyz.sun.ok@gmail.com>
> ---
>  drivers/staging/qlge/qlge_main.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-17  5:46 [PATCH] staging: qlge: unmap dma when lock failed Xiangyang Zhang
2020-05-18  4:54 ` Benjamin Poirier

DriverDev-Devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/driverdev-devel/0 driverdev-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 driverdev-devel driverdev-devel/ https://lore.kernel.org/driverdev-devel \
		driverdev-devel@linuxdriverproject.org devel@driverdev.osuosl.org
	public-inbox-index driverdev-devel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.linuxdriverproject.driverdev-devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git