hc
2024-05-10 37f49e37ab4cb5d0bc4c60eb5c6d4dd57db767bb
kernel/drivers/crypto/cavium/zip/zip_crypto.c
....@@ -69,7 +69,7 @@
6969 zip_ops->csum = 1; /* Adler checksum desired */
7070 }
7171
72
-int zip_ctx_init(struct zip_kernel_ctx *zip_ctx, int lzs_flag)
72
+static int zip_ctx_init(struct zip_kernel_ctx *zip_ctx, int lzs_flag)
7373 {
7474 struct zip_operation *comp_ctx = &zip_ctx->zip_comp;
7575 struct zip_operation *decomp_ctx = &zip_ctx->zip_decomp;
....@@ -107,7 +107,7 @@
107107 return -ENOMEM;
108108 }
109109
110
-void zip_ctx_exit(struct zip_kernel_ctx *zip_ctx)
110
+static void zip_ctx_exit(struct zip_kernel_ctx *zip_ctx)
111111 {
112112 struct zip_operation *comp_ctx = &zip_ctx->zip_comp;
113113 struct zip_operation *dec_ctx = &zip_ctx->zip_decomp;
....@@ -119,7 +119,7 @@
119119 zip_data_buf_free(dec_ctx->output, MAX_OUTPUT_BUFFER_SIZE);
120120 }
121121
122
-int zip_compress(const u8 *src, unsigned int slen,
122
+static int zip_compress(const u8 *src, unsigned int slen,
123123 u8 *dst, unsigned int *dlen,
124124 struct zip_kernel_ctx *zip_ctx)
125125 {
....@@ -155,7 +155,7 @@
155155 return ret;
156156 }
157157
158
-int zip_decompress(const u8 *src, unsigned int slen,
158
+static int zip_decompress(const u8 *src, unsigned int slen,
159159 u8 *dst, unsigned int *dlen,
160160 struct zip_kernel_ctx *zip_ctx)
161161 {
....@@ -260,7 +260,7 @@
260260 ret = zip_ctx_init(zip_ctx, 0);
261261
262262 if (ret) {
263
- kzfree(zip_ctx);
263
+ kfree_sensitive(zip_ctx);
264264 return ERR_PTR(ret);
265265 }
266266
....@@ -279,7 +279,7 @@
279279 ret = zip_ctx_init(zip_ctx, 1);
280280
281281 if (ret) {
282
- kzfree(zip_ctx);
282
+ kfree_sensitive(zip_ctx);
283283 return ERR_PTR(ret);
284284 }
285285
....@@ -291,7 +291,7 @@
291291 struct zip_kernel_ctx *zip_ctx = ctx;
292292
293293 zip_ctx_exit(zip_ctx);
294
- kzfree(zip_ctx);
294
+ kfree_sensitive(zip_ctx);
295295 }
296296
297297 int zip_scomp_compress(struct crypto_scomp *tfm,