hc
2024-05-10 ee930fffee469d076998274a2ca55e13dc1efb67
kernel/crypto/zstd.c
....@@ -1,16 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Cryptographic API.
34 *
45 * Copyright (c) 2017-present, Facebook, Inc.
5
- *
6
- * This program is free software; you can redistribute it and/or modify it
7
- * under the terms of the GNU General Public License version 2 as published by
8
- * the Free Software Foundation.
9
- *
10
- * This program is distributed in the hope that it will be useful, but WITHOUT
11
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13
- * more details.
146 */
157 #include <linux/crypto.h>
168 #include <linux/init.h>
....@@ -145,7 +137,7 @@
145137 static void zstd_free_ctx(struct crypto_scomp *tfm, void *ctx)
146138 {
147139 __zstd_exit(ctx);
148
- kzfree(ctx);
140
+ kfree_sensitive(ctx);
149141 }
150142
151143 static void zstd_exit(struct crypto_tfm *tfm)
....@@ -214,6 +206,7 @@
214206
215207 static struct crypto_alg alg = {
216208 .cra_name = "zstd",
209
+ .cra_driver_name = "zstd-generic",
217210 .cra_flags = CRYPTO_ALG_TYPE_COMPRESS,
218211 .cra_ctxsize = sizeof(struct zstd_ctx),
219212 .cra_module = THIS_MODULE,
....@@ -257,7 +250,7 @@
257250 crypto_unregister_scomp(&scomp);
258251 }
259252
260
-module_init(zstd_mod_init);
253
+subsys_initcall(zstd_mod_init);
261254 module_exit(zstd_mod_fini);
262255
263256 MODULE_LICENSE("GPL");