| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * 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. |
|---|
| 7 | 4 | */ |
|---|
| 8 | 5 | |
|---|
| 9 | 6 | #include <linux/interrupt.h> |
|---|
| .. | .. |
|---|
| 77 | 74 | for (i = 0; i < cptvf->nr_queues; i++) |
|---|
| 78 | 75 | tasklet_kill(&cwqe_info->vq_wqe[i].twork); |
|---|
| 79 | 76 | |
|---|
| 80 | | - kzfree(cwqe_info); |
|---|
| 77 | + kfree_sensitive(cwqe_info); |
|---|
| 81 | 78 | cptvf->wqe_info = NULL; |
|---|
| 82 | 79 | } |
|---|
| 83 | 80 | |
|---|
| .. | .. |
|---|
| 91 | 88 | continue; |
|---|
| 92 | 89 | |
|---|
| 93 | 90 | /* free single queue */ |
|---|
| 94 | | - kzfree((queue->head)); |
|---|
| 91 | + kfree_sensitive((queue->head)); |
|---|
| 95 | 92 | |
|---|
| 96 | 93 | queue->front = 0; |
|---|
| 97 | 94 | queue->rear = 0; |
|---|
| .. | .. |
|---|
| 192 | 189 | chunk->head = NULL; |
|---|
| 193 | 190 | chunk->dma_addr = 0; |
|---|
| 194 | 191 | hlist_del(&chunk->nextchunk); |
|---|
| 195 | | - kzfree(chunk); |
|---|
| 192 | + kfree_sensitive(chunk); |
|---|
| 196 | 193 | } |
|---|
| 197 | 194 | |
|---|
| 198 | 195 | queue->nchunks = 0; |
|---|
| .. | .. |
|---|
| 236 | 233 | |
|---|
| 237 | 234 | c_size = (rem_q_size > qcsize_bytes) ? qcsize_bytes : |
|---|
| 238 | 235 | 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); |
|---|
| 242 | 240 | if (!curr->head) { |
|---|
| 243 | 241 | dev_err(&pdev->dev, "Command Q (%d) chunk (%d) allocation failed\n", |
|---|
| 244 | 242 | i, queue->nchunks); |
|---|
| .. | .. |
|---|
| 640 | 638 | cpt_write_csr64(cptvf->reg_base, CPTX_VQX_SADDR(0, 0), vqx_saddr.u); |
|---|
| 641 | 639 | } |
|---|
| 642 | 640 | |
|---|
| 643 | | -void cptvf_device_init(struct cpt_vf *cptvf) |
|---|
| 641 | +static void cptvf_device_init(struct cpt_vf *cptvf) |
|---|
| 644 | 642 | { |
|---|
| 645 | 643 | u64 base_addr = 0; |
|---|
| 646 | 644 | |
|---|