backport: Fix the bug in OptCheck.check() introduced in cb779a71bf57d95b
[kconfig-hardened-check.git] / kconfig_hardened_check / __init__.py
index 534978b0f484828039fba327e1c36bb281444b36..5bc0d375d5df8de038e4e50a8e0b8ae26d7c0b37 100644 (file)
@@ -96,7 +96,7 @@ class OptCheck:
         if self.expected == 'is not off':
             if self.state == 'off':
                 self.result = 'FAIL: is off'
-            if self.state == '0':
+            elif self.state == '0':
                 self.result = 'FAIL: is off, "0"'
             elif self.state is None:
                 self.result = 'FAIL: is off, not found'
@@ -766,7 +766,7 @@ def add_cmdline_checks(l, arch):
     l += [OR(CmdlineCheck('self_protection', 'kspp', 'slab_nomerge', 'is present'),
              AND(KconfigCheck('self_protection', 'clipos', 'SLAB_MERGE_DEFAULT', 'is not set'),
                  CmdlineCheck('self_protection', 'kspp', 'slab_merge', 'is not set'),
-                 CmdlineCheck('self_protection', 'kspp', 'slub_merge', 'is not set')))]
+                 CmdlineCheck('self_protection', 'clipos', 'slub_merge', 'is not set')))]
     l += [OR(CmdlineCheck('self_protection', 'kspp', 'iommu.strict', '1'),
              AND(KconfigCheck('self_protection', 'kspp', 'IOMMU_DEFAULT_DMA_STRICT', 'y'),
                  CmdlineCheck('self_protection', 'kspp', 'iommu.strict', 'is not set')))]