From 3cc770a9def805737944aa306c9c2d4d2c35e923 Mon Sep 17 00:00:00 2001 From: GarfieldHan <2652609017@qq.com> Date: Tue, 7 May 2024 22:25:32 +0800 Subject: [PATCH] critical_partition_protect: Fix wrong branch predict Signed-off-by: GarfieldHan <2652609017@qq.com> --- src/critical_partition_protect/critical_partition_protect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/critical_partition_protect/critical_partition_protect.c b/src/critical_partition_protect/critical_partition_protect.c index f86c416..3a66764 100644 --- a/src/critical_partition_protect/critical_partition_protect.c +++ b/src/critical_partition_protect/critical_partition_protect.c @@ -33,7 +33,7 @@ hook_func_no_info(do_filp_open); static struct file *hook_replace(do_filp_open)(int dfd, struct filename *pathname, const struct open_flags *op) { struct file *filp = hook_call_backup(do_filp_open, dfd, pathname, op); - if (unlikely(!IS_ERR(filp))) { + if (likely(!IS_ERR(filp))) { char buf[PATH_MAX]; memset(&buf, 0, PATH_MAX); char *currPath = skfunc(d_path)(&filp->f_path, buf, PATH_MAX);