From cf5217d55b2a603cfa0a852d876809c536835f18 Mon Sep 17 00:00:00 2001
From: renoseven <dev@renoseven.net>
Date: Fri, 17 May 2024 14:46:30 +0800
Subject: [PATCH] syscared: fix 'apply kernel module patch failure' issue

Signed-off-by: renoseven <dev@renoseven.net>
---
 syscared/src/patch/driver/kpatch/mod.rs | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/syscared/src/patch/driver/kpatch/mod.rs b/syscared/src/patch/driver/kpatch/mod.rs
index 307efb5..970da92 100644
--- a/syscared/src/patch/driver/kpatch/mod.rs
+++ b/syscared/src/patch/driver/kpatch/mod.rs
@@ -128,6 +128,9 @@ impl KernelPatchDriver {
         debug!("Patch target:   '{}'", patch_target);
         debug!("Current kernel: '{}'", current_kernel.to_string_lossy());
 
+        if !patch_target.starts_with("KERNEL_NAME_PREFIX") {
+            return Ok(());
+        }
         ensure!(
             current_kernel == patch_target,
             "Kpatch: Patch is incompatible",
-- 
2.41.0

