From bedbef8ad3e75a304af6361af235302bcc61d06b Mon Sep 17 00:00:00 2001 From: hc <hc@nodka.com> Date: Tue, 14 May 2024 06:39:01 +0000 Subject: [PATCH] 修改内核路径 --- kernel/samples/hw_breakpoint/data_breakpoint.c | 19 ++++--------------- 1 files changed, 4 insertions(+), 15 deletions(-) diff --git a/kernel/samples/hw_breakpoint/data_breakpoint.c b/kernel/samples/hw_breakpoint/data_breakpoint.c index 3739481..b99322f 100644 --- a/kernel/samples/hw_breakpoint/data_breakpoint.c +++ b/kernel/samples/hw_breakpoint/data_breakpoint.c @@ -1,19 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * data_breakpoint.c - Sample HW Breakpoint file to watch kernel data address - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * usage: insmod data_breakpoint.ko ksym=<ksym_name> * @@ -83,7 +70,9 @@ static void __exit hw_break_module_exit(void) { unregister_wide_hw_breakpoint(sample_hbp); - symbol_put(ksym_name); +#ifdef CONFIG_MODULE_UNLOAD + __symbol_put(ksym_name); +#endif printk(KERN_INFO "HW Breakpoint for %s write uninstalled\n", ksym_name); } -- Gitblit v1.6.2