[PATCH] memstick: tifm_ms: use the correct DMA direction on removal
From: Avi Weiss
Date: Fri Oct 30 2026 - 08:36:58 EST
tifm_ms_issue_cmd() maps READ requests with DMA_FROM_DEVICE and
WRITE requests with DMA_TO_DEVICE. When a request is active during
removal, tifm_ms_remove() unmaps it using the opposite direction.
Use the original mapping direction when unmapping an active
request, matching the normal completion path.
Fixes: baf8532a147d ("memstick: initial commit for Sony MemoryStick support")
Signed-off-by: Avi Weiss <thnkslprpt@xxxxxxxxx>
---
drivers/memstick/host/tifm_ms.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/memstick/host/tifm_ms.c b/drivers/memstick/host/tifm_ms.c
index 0a54586aa54e8..171aadd4ec71a 100644
--- a/drivers/memstick/host/tifm_ms.c
+++ b/drivers/memstick/host/tifm_ms.c
@@ -606,8 +606,8 @@ static void tifm_ms_remove(struct tifm_dev *sock)
if (host->use_dma)
tifm_unmap_sg(sock, &host->req->sg, 1,
host->req->data_dir == READ
- ? DMA_TO_DEVICE
- : DMA_FROM_DEVICE);
+ ? DMA_FROM_DEVICE
+ : DMA_TO_DEVICE);
host->req->error = -ETIME;
do {
base-commit: d89e1d186ec9271bf78e62771779e9fc03bf0fc3
--
2.43.0