public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] gpib: fluke: Fix an error handling path in fluke_dma_read()
@ 2025-12-06  7:02 Christophe JAILLET
  2025-12-09 13:47 ` Dan Carpenter
  0 siblings, 1 reply; 2+ messages in thread
From: Christophe JAILLET @ 2025-12-06  7:02 UTC (permalink / raw)
  To: Dave Penkler, Greg Kroah-Hartman
  Cc: linux-kernel, kernel-janitors, Christophe JAILLET

It is strange to call dma_unmap_single() with its 'dev' argument
explicitly set to NULL.
It is likely to crash.

Fix it by passing 'board->dev' as done in all other cases in
fluke_dma_read().

Fixes: 55936779f496 ("staging: gpib: Add Fluke cda based cards GPIB driver")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
This patch is compile tested only.
---
 drivers/gpib/eastwood/fluke_gpib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpib/eastwood/fluke_gpib.c b/drivers/gpib/eastwood/fluke_gpib.c
index 3ae848e3f738..61eca22dc2b0 100644
--- a/drivers/gpib/eastwood/fluke_gpib.c
+++ b/drivers/gpib/eastwood/fluke_gpib.c
@@ -586,7 +586,7 @@ static int fluke_dma_read(struct gpib_board *board, u8 *buffer,
 					      DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
 	if (!tx_desc) {
 		dev_err(board->gpib_dev, "failed to allocate dma transmit descriptor\n");
-		dma_unmap_single(NULL, bus_address, length, DMA_FROM_DEVICE);
+		dma_unmap_single(board->dev, bus_address, length, DMA_FROM_DEVICE);
 		return -EIO;
 	}
 	tx_desc->callback = fluke_dma_callback;
-- 
2.52.0


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

end of thread, other threads:[~2025-12-09 13:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-06  7:02 [PATCH] gpib: fluke: Fix an error handling path in fluke_dma_read() Christophe JAILLET
2025-12-09 13:47 ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox