Skip to content

Commit d78abcb

Browse files
arndbaxboe
authored andcommitted
nvme: target: fix nvme_keyring_id() references
In configurations without CONFIG_NVME_TARGET_TCP_TLS, the keyring code might not be available, or using it will result in a runtime failure: x86_64-linux-ld: vmlinux.o: in function `nvmet_ports_make': configfs.c:(.text+0x100a211): undefined reference to `nvme_keyring_id' Add a check to ensure we only check the keyring if there is a chance of it being used, which avoids both the runtime and link-time problems. Signed-off-by: Arnd Bergmann <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 55072cd commit d78abcb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/nvme/target/configfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1893,7 +1893,7 @@ static struct config_group *nvmet_ports_make(struct config_group *group,
18931893
return ERR_PTR(-ENOMEM);
18941894
}
18951895

1896-
if (nvme_keyring_id()) {
1896+
if (IS_ENABLED(CONFIG_NVME_TARGET_TCP_TLS) && nvme_keyring_id()) {
18971897
port->keyring = key_lookup(nvme_keyring_id());
18981898
if (IS_ERR(port->keyring)) {
18991899
pr_warn("NVMe keyring not available, disabling TLS\n");

0 commit comments

Comments
 (0)