nvme-auth: fix an error code in nvme_auth_process_dhchap_challenge()
authorDan Carpenter <error27@gmail.com>
Thu, 16 Feb 2023 12:14:49 +0000 (15:14 +0300)
committerChristoph Hellwig <hch@lst.de>
Tue, 28 Feb 2023 13:14:44 +0000 (06:14 -0700)
This function was transitioned from returning NVMe status codes to
returning traditional kernel error codes.  However, this particular
return now accidentally returns positive error codes like ENOMEM instead
of negative -ENOMEM.

Fixes: b0ef1b11d390 ("nvme-auth: don't use NVMe status codes")
Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/auth.c

index 7875374..3e96714 100644 (file)
@@ -254,7 +254,7 @@ select_kpp:
                                 chap->qid, ret, gid_name);
                        chap->status = NVME_AUTH_DHCHAP_FAILURE_DHGROUP_UNUSABLE;
                        chap->dh_tfm = NULL;
-                       return -ret;
+                       return ret;
                }
                dev_dbg(ctrl->device, "qid %d: selected DH group %s\n",
                        chap->qid, gid_name);