hc
2024-05-10 23fa18eaa71266feff7ba8d83022d9e1cc83c65a
kernel/samples/livepatch/livepatch-sample.c
....@@ -1,20 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * livepatch-sample.c - Kernel Live Patching Sample Module
34 *
45 * Copyright (C) 2014 Seth Jennings <sjenning@redhat.com>
5
- *
6
- * This program is free software; you can redistribute it and/or
7
- * modify it under the terms of the GNU General Public License
8
- * as published by the Free Software Foundation; either version 2
9
- * of the License, or (at your option) any later version.
10
- *
11
- * This program is distributed in the hope that it will be useful,
12
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- * GNU General Public License for more details.
15
- *
16
- * You should have received a copy of the GNU General Public License
17
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
186 */
197
208 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
....@@ -69,22 +57,11 @@
6957
7058 static int livepatch_init(void)
7159 {
72
- int ret;
73
-
74
- ret = klp_register_patch(&patch);
75
- if (ret)
76
- return ret;
77
- ret = klp_enable_patch(&patch);
78
- if (ret) {
79
- WARN_ON(klp_unregister_patch(&patch));
80
- return ret;
81
- }
82
- return 0;
60
+ return klp_enable_patch(&patch);
8361 }
8462
8563 static void livepatch_exit(void)
8664 {
87
- WARN_ON(klp_unregister_patch(&patch));
8865 }
8966
9067 module_init(livepatch_init);