hc
2024-02-20 e636c8d336489bf3eed5878299e6cc045bbad077
kernel/samples/livepatch/livepatch-callbacks-demo.c
....@@ -1,18 +1,6 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Copyright (C) 2017 Joe Lawrence <joe.lawrence@redhat.com>
3
- *
4
- * This program is free software; you can redistribute it and/or
5
- * modify it under the terms of the GNU General Public License
6
- * as published by the Free Software Foundation; either version 2
7
- * of the License, or (at your option) any later version.
8
- *
9
- * This program is distributed in the hope that it will be useful,
10
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- * GNU General Public License for more details.
13
- *
14
- * You should have received a copy of the GNU General Public License
15
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
164 */
175
186 /*
....@@ -195,22 +183,11 @@
195183
196184 static int livepatch_callbacks_demo_init(void)
197185 {
198
- int ret;
199
-
200
- ret = klp_register_patch(&patch);
201
- if (ret)
202
- return ret;
203
- ret = klp_enable_patch(&patch);
204
- if (ret) {
205
- WARN_ON(klp_unregister_patch(&patch));
206
- return ret;
207
- }
208
- return 0;
186
+ return klp_enable_patch(&patch);
209187 }
210188
211189 static void livepatch_callbacks_demo_exit(void)
212190 {
213
- WARN_ON(klp_unregister_patch(&patch));
214191 }
215192
216193 module_init(livepatch_callbacks_demo_init);