History

crypto: marvell/octeontx - Use kcalloc() instead of kzalloc()

Use 2-factor multiplication argument form kcalloc() instead of kzalloc().

Gustavo A. R. Silva committed 4 years ago

Commit 0b62b661 parent 61a13711 file · +1 −3Browse files

Unified · Split

drivers/crypto/marvell/octeontx/otx_cptvf_main.c+1−3
@@ -94,15 +94,13 @@ static int alloc_pending_queues(struct otx_cpt_pending_qinfo *pqinfo, u32 qlen, · 93 unmodified lines
94 u32 num_queues)94 u32 num_queues)
95{95{
96 struct otx_cpt_pending_queue *queue = NULL;96 struct otx_cpt_pending_queue *queue = NULL;
97 size_t size;
98 int ret;97 int ret;
99 u32 i;98 u32 i;
100 99
101 pqinfo->num_queues = num_queues;100 pqinfo->num_queues = num_queues;
102 size = (qlen * sizeof(struct otx_cpt_pending_entry));
103 101
104 for_each_pending_queue(pqinfo, queue, i) {102 for_each_pending_queue(pqinfo, queue, i) {
105 queue->head = kzalloc((size), GFP_KERNEL);103 queue->head = kcalloc(qlen, sizeof(*queue->head), GFP_KERNEL);
106 if (!queue->head) {104 if (!queue->head) {
107 ret = -ENOMEM;105 ret = -ENOMEM;
108 goto pending_qfail;106 goto pending_qfail;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t