[skip ci]: kernel: simplify KPM enabled check in ksu_handle_prctl

This commit is contained in:
ShirkNeko
2025-05-24 15:25:54 +08:00
parent 7e88e9648f
commit 8f4c58c4c3
3 changed files with 6 additions and 13 deletions

View File

@@ -430,14 +430,9 @@ int ksu_handle_prctl(int option, unsigned long arg2, unsigned long arg3,
#endif
if (arg2 == CMD_ENABLE_KPM) {
#ifdef CONFIG_KPM
bool KPM_Enabled = true;
#else
bool KPM_Enabled = false;
#endif
if (copy_to_user((void __user *)arg3, &KPM_Enabled, sizeof(KPM_Enabled))) {
bool KPM_Enabled = IS_ENABLED(CONFIG_KPM);
if (copy_to_user((void __user *)arg3, &KPM_Enabled, sizeof(KPM_Enabled)))
pr_info("KPM: copy_to_user() failed\n");
}
return 0;
}