hc
2024-05-10 37f49e37ab4cb5d0bc4c60eb5c6d4dd57db767bb
kernel/drivers/crypto/cavium/cpt/cptvf_main.c
....@@ -1,9 +1,6 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright (C) 2016 Cavium, Inc.
3
- *
4
- * This program is free software; you can redistribute it and/or modify
5
- * it under the terms of version 2 of the GNU General Public License
6
- * as published by the Free Software Foundation.
74 */
85
96 #include <linux/interrupt.h>
....@@ -77,7 +74,7 @@
7774 for (i = 0; i < cptvf->nr_queues; i++)
7875 tasklet_kill(&cwqe_info->vq_wqe[i].twork);
7976
80
- kzfree(cwqe_info);
77
+ kfree_sensitive(cwqe_info);
8178 cptvf->wqe_info = NULL;
8279 }
8380
....@@ -91,7 +88,7 @@
9188 continue;
9289
9390 /* free single queue */
94
- kzfree((queue->head));
91
+ kfree_sensitive((queue->head));
9592
9693 queue->front = 0;
9794 queue->rear = 0;
....@@ -192,7 +189,7 @@
192189 chunk->head = NULL;
193190 chunk->dma_addr = 0;
194191 hlist_del(&chunk->nextchunk);
195
- kzfree(chunk);
192
+ kfree_sensitive(chunk);
196193 }
197194
198195 queue->nchunks = 0;
....@@ -236,9 +233,10 @@
236233
237234 c_size = (rem_q_size > qcsize_bytes) ? qcsize_bytes :
238235 rem_q_size;
239
- curr->head = (u8 *)dma_zalloc_coherent(&pdev->dev,
240
- c_size + CPT_NEXT_CHUNK_PTR_SIZE,
241
- &curr->dma_addr, GFP_KERNEL);
236
+ curr->head = (u8 *)dma_alloc_coherent(&pdev->dev,
237
+ c_size + CPT_NEXT_CHUNK_PTR_SIZE,
238
+ &curr->dma_addr,
239
+ GFP_KERNEL);
242240 if (!curr->head) {
243241 dev_err(&pdev->dev, "Command Q (%d) chunk (%d) allocation failed\n",
244242 i, queue->nchunks);
....@@ -640,7 +638,7 @@
640638 cpt_write_csr64(cptvf->reg_base, CPTX_VQX_SADDR(0, 0), vqx_saddr.u);
641639 }
642640
643
-void cptvf_device_init(struct cpt_vf *cptvf)
641
+static void cptvf_device_init(struct cpt_vf *cptvf)
644642 {
645643 u64 base_addr = 0;
646644