]> git.ipfire.org Git - thirdparty/linux.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)
committerHeiko Carstens <hca@linux.ibm.com>
Fri, 24 Oct 2025 13:25:56 +0000 (15:25 +0200)
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>
drivers/s390/crypto/ap_bus.c

index c8589ac744e4b8d96f2fb8906a43181fb5f765e6..82f4ac97fe976108ef69c89c32dcc3cd9e1ebea3 100644 (file)
@@ -2494,15 +2494,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);