linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@kernel.org>
To: Christoph Hellwig <hch@lst.de>
Cc: Keith Busch <kbusch@kernel.org>, Sagi Grimberg <sagi@grimberg.me>,
	linux-nvme@lists.infradead.org, Hannes Reinecke <hare@kernel.org>,
	kernel test robot <lkp@intel.com>
Subject: [PATCH 3/4] nvme-fabrics: make call to nvme_auth_extract_key() conditional
Date: Wed,  1 Oct 2025 17:13:50 +0200	[thread overview]
Message-ID: <20251001151351.121181-4-hare@kernel.org> (raw)
In-Reply-To: <20251001151351.121181-1-hare@kernel.org>

nvme_auth_extract_key() is only available if the authentication
code is compiled in, so make it condititional on the config option.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202509302359.TL1868ni-lkp@intel.com/
Signed-off-by: Hannes Reinecke <hare@kernel.org>
---
 drivers/nvme/host/fabrics.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/nvme/host/fabrics.c b/drivers/nvme/host/fabrics.c
index 3d4d6d8e88c4..67b2ad5ae0fd 100644
--- a/drivers/nvme/host/fabrics.c
+++ b/drivers/nvme/host/fabrics.c
@@ -1106,6 +1106,7 @@ static int nvmf_parse_options(struct nvmf_ctrl_options *opts,
 	}
 
 	if (host_secret) {
+#ifdef CONFIG_NVME_HOST_AUTH
 		pr_debug("lookup host identity '%s'\n", host_secret);
 		key = nvme_auth_extract_key(opts->keyring, host_secret,
 					    strlen(host_secret),
@@ -1116,8 +1117,13 @@ static int nvmf_parse_options(struct nvmf_ctrl_options *opts,
 		}
 		pr_debug("using dhchap key %08x\n", key_serial(key));
 		opts->dhchap_key = key;
+#else
+		ret = -EINVAL;
+		goto out;
+#endif
 	}
 	if (ctrl_secret) {
+#ifdef CONFIG_NVME_HOST_AUTH
 		if (!opts->dhchap_key) {
 			ret = -EINVAL;
 			goto out;
@@ -1132,6 +1138,10 @@ static int nvmf_parse_options(struct nvmf_ctrl_options *opts,
 		}
 		pr_debug("using dhchap ctrl key %08x\n", key_serial(key));
 		opts->dhchap_ctrl_key = key;
+#else
+		ret = -EINVAL;
+		goto out;
+#endif
 	}
 
 	if (opts->concat) {
-- 
2.43.0



  parent reply	other threads:[~2025-10-01 15:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-01 15:13 [PATCHv2 0/4] nvme-keyring: kbuild fixes Hannes Reinecke
2025-10-01 15:13 ` [PATCH 1/4] nvme-keyring: use correct format specifier Hannes Reinecke
2025-10-01 15:13 ` [PATCH 2/4] nvme-keyring: typo in nvme_dhchap_psk_lookup() Hannes Reinecke
2025-10-01 15:13 ` Hannes Reinecke [this message]
2025-10-01 15:13 ` [PATCH 4/4] nvme-keyring: fixup declaration of nvme_dhchap_psk_hash() Hannes Reinecke
2025-10-01 15:32 ` [PATCHv2 0/4] nvme-keyring: kbuild fixes Chris Leech

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251001151351.121181-4-hare@kernel.org \
    --to=hare@kernel.org \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=lkp@intel.com \
    --cc=sagi@grimberg.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).