aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/nvme
diff options
context:
space:
mode:
authorMark O'Donovan <shiftee@posteo.net>2023-10-25 10:51:23 +0000
committerKeith Busch <kbusch@kernel.org>2023-11-06 08:34:15 -0800
commit75276847f4e262a52ccaf1a1c6b929280ddf77f6 (patch)
tree54490c1a9293d0395aba67da6319ced74b7983d4 /drivers/nvme
parent1147dd0503564fa0e03489a039f9e0c748a03db4 (diff)
downloadlinux-75276847f4e262a52ccaf1a1c6b929280ddf77f6.tar.gz
nvme-auth: auth success1 msg always includes resp
In cases where RVALID is false, the response is still transmitted, but is cleared to zero. Relevant extract from the spec: Response R2, if valid (i.e., if the RVALID field is set to 01h), cleared to 0h otherwise Signed-off-by: Mark O'Donovan <shiftee@posteo.net> Reviewed-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Sagi Grimberg <sagi@grimberg.me> Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/nvme')
-rw-r--r--drivers/nvme/host/auth.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/nvme/host/auth.c b/drivers/nvme/host/auth.c
index eaefebb2a799a..5885bb0d5a9a6 100644
--- a/drivers/nvme/host/auth.c
+++ b/drivers/nvme/host/auth.c
@@ -339,10 +339,7 @@ static int nvme_auth_process_dhchap_success1(struct nvme_ctrl *ctrl,
struct nvme_dhchap_queue_context *chap)
{
struct nvmf_auth_dhchap_success1_data *data = chap->buf;
- size_t size = sizeof(*data);
-
- if (chap->s2)
- size += chap->hash_len;
+ size_t size = sizeof(*data) + chap->hash_len;
if (size > CHAP_BUF_SIZE) {
chap->status = NVME_AUTH_DHCHAP_FAILURE_INCORRECT_PAYLOAD;