]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
s390/ap: Don't leak debug feature files if AP instructions are not available
authorHeiko Carstens <hca@linux.ibm.com>
Fri, 24 Oct 2025 10:24:33 +0000 (12:24 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Dec 2025 12:54:47 +0000 (13:54 +0100)
[ Upstream commit 020d5dc57874e58d3ebae398f3fe258f029e3d06 ]

If no AP instructions are available the AP bus module leaks registered
debug feature files. Change function call order to fix this.

Fixes: cccd85bfb7bf ("s390/zcrypt: Rework debug feature invocations.")
Reviewed-by: Harald Freudenberger <freude@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/s390/crypto/ap_bus.c

index e14638936de6b8773a43aec14b04df94f26e6357..e7068016a98684b83c8cbb6df8fab71f2a64e1a7 100644 (file)
@@ -2419,15 +2419,15 @@ static int __init ap_module_init(void)
 {
        int rc;
 
-       rc = ap_debug_init();
-       if (rc)
-               return rc;
-
        if (!ap_instructions_available()) {
                pr_warn("The hardware system does not support AP instructions\n");
                return -ENODEV;
        }
 
+       rc = ap_debug_init();
+       if (rc)
+               return rc;
+
        /* init ap_queue hashtable */
        hash_init(ap_queues);