mirror of
https://github.com/torvalds/linux.git
synced 2026-06-06 05:27:07 +02:00
nvmet-tcp: fix data digest pointer calculation
commite790de54e9upstream. 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:872d26a391("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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
d98883f6c3
commit
4286c72c53
|
|
@ -690,7 +690,7 @@ static int nvmet_try_send_ddgst(struct nvmet_tcp_cmd *cmd, bool last_in_batch)
|
||||||
struct nvmet_tcp_queue *queue = cmd->queue;
|
struct nvmet_tcp_queue *queue = cmd->queue;
|
||||||
struct msghdr msg = { .msg_flags = MSG_DONTWAIT };
|
struct msghdr msg = { .msg_flags = MSG_DONTWAIT };
|
||||||
struct kvec iov = {
|
struct kvec iov = {
|
||||||
.iov_base = &cmd->exp_ddgst + cmd->offset,
|
.iov_base = (u8 *)&cmd->exp_ddgst + cmd->offset,
|
||||||
.iov_len = NVME_TCP_DIGEST_LENGTH - cmd->offset
|
.iov_len = NVME_TCP_DIGEST_LENGTH - cmd->offset
|
||||||
};
|
};
|
||||||
int ret;
|
int ret;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user