Skip to content

Commit e790de5

Browse files
Varun PrakashChristoph Hellwig
authored andcommitted
nvmet-tcp: fix data digest pointer calculation
exp_ddgst is of type __le32, &cmd->exp_ddgst + cmd->offset increases &cmd->exp_ddgst by 4 * cmd->offset, fix this by type casting &cmd->exp_ddgst to u8 *. Fixes: 872d26a ("nvmet-tcp: add NVMe over TCP target driver") Signed-off-by: Varun Prakash <varun@chelsio.com> Reviewed-by: Sagi Grimberg <sagi@grimberg.me> Signed-off-by: Christoph Hellwig <hch@lst.de>
1 parent d89b9f3 commit e790de5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/nvme/target/tcp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ static int nvmet_try_send_ddgst(struct nvmet_tcp_cmd *cmd, bool last_in_batch)
702702
struct nvmet_tcp_queue *queue = cmd->queue;
703703
struct msghdr msg = { .msg_flags = MSG_DONTWAIT };
704704
struct kvec iov = {
705-
.iov_base = &cmd->exp_ddgst + cmd->offset,
705+
.iov_base = (u8 *)&cmd->exp_ddgst + cmd->offset,
706706
.iov_len = NVME_TCP_DIGEST_LENGTH - cmd->offset
707707
};
708708
int ret;

0 commit comments

Comments
 (0)