diff options
author | Varun Prakash <varun@chelsio.com> | 2021-10-25 22:46:54 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-11-02 19:46:13 +0100 |
commit | b597b0e2e80bcac733e3e364a51afb81d61c0e5b (patch) | |
tree | 316a92a53e6badc307a04fbdd345cf2e7291191d /drivers/nvme | |
parent | d997d4e4365f7e59cf6b59c70f966c56d704b64f (diff) | |
download | linux-stable-b597b0e2e80bcac733e3e364a51afb81d61c0e5b.tar.gz linux-stable-b597b0e2e80bcac733e3e364a51afb81d61c0e5b.tar.bz2 linux-stable-b597b0e2e80bcac733e3e364a51afb81d61c0e5b.zip |
nvmet-tcp: fix data digest pointer calculation
commit e790de54e94a7a15fb725b34724d41d41cbaa60c upstream.
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: 872d26a391da ("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>
Diffstat (limited to 'drivers/nvme')
-rw-r--r-- | drivers/nvme/target/tcp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/nvme/target/tcp.c b/drivers/nvme/target/tcp.c index 2ae846297d7c..2f4e512bd449 100644 --- a/drivers/nvme/target/tcp.c +++ b/drivers/nvme/target/tcp.c @@ -633,7 +633,7 @@ static int nvmet_try_send_ddgst(struct nvmet_tcp_cmd *cmd) struct nvmet_tcp_queue *queue = cmd->queue; struct msghdr msg = { .msg_flags = MSG_DONTWAIT }; 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 }; int ret; |