Skip to contentSkip to conversation

nvme-tcp: fix data digest pointer calculation

PATCH In review Varun Prakash 3 participants 3 messages Oct 25, 2021 – Oct 27, 2021 NVMe

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nvme-tcp: fix data digest pointer calculation

ddgst is of type __le32, &req->ddgst + req->offset increases &req->ddgst by 4 * req->offset, fix this by type casting &req->ddgst to u8 *.

Fixes 3f2304f8c6d6 ("nvme-tcp: add NVMe over TCP host driver")
---
 drivers/nvme/host/tcp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/host/tcp.c +1 -1
index 3c1c29d..22da856 100644
@@ -1051,7 +1051,7 @@ static int nvme_tcp_try_send_ddgst(struct nvme_tcp_request *req)
 	int ret;
 	struct msghdr msg = { .msg_flags = MSG_DONTWAIT };
 	struct kvec iov = {
-		.iov_base = &req->ddgst + req->offset,
+		.iov_base = (u8 *)&req->ddgst + req->offset,
 		.iov_len = NVME_TCP_DIGEST_LENGTH - req->offset
 	};
 
Signature · 1 line
2.0.2