mirror of
https://github.com/torvalds/linux.git
synced 2026-09-25 21:21:09 -04:00
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]>
This commit is contained in:
committed by
Jens Axboe
parent
55072cd7ce
commit
d78abcbabe
@@ -1893,7 +1893,7 @@ static struct config_group *nvmet_ports_make(struct config_group *group,
|
||||
return ERR_PTR(-ENOMEM);
|
||||
}
|
||||
|
||||
if (nvme_keyring_id()) {
|
||||
if (IS_ENABLED(CONFIG_NVME_TARGET_TCP_TLS) && nvme_keyring_id()) {
|
||||
port->keyring = key_lookup(nvme_keyring_id());
|
||||
if (IS_ERR(port->keyring)) {
|
||||
pr_warn("NVMe keyring not available, disabling TLS\n");
|
||||
|
||||
Reference in New Issue
Block a user