Use 2-factor multiplication argument form kcalloc() instead of kzalloc().
Unified · Split
| @@ -94,15 +94,13 @@ static int alloc_pending_queues(struct otx_cpt_pending_qinfo *pqinfo, u32 qlen, · 93 unmodified lines | ||
| 94 | 94 | u32 num_queues) |
| 95 | 95 | { |
| 96 | 96 | struct otx_cpt_pending_queue *queue = NULL; |
| 97 | − size_t size; | |
| 98 | 97 | int ret; |
| 99 | 98 | u32 i; |
| 100 | 99 | |
| 101 | 100 | pqinfo->num_queues = num_queues; |
| 102 | − size = (qlen * sizeof(struct otx_cpt_pending_entry)); | |
| 103 | 101 | |
| 104 | 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 | 104 | if (!queue->head) { |
| 107 | 105 | ret = -ENOMEM; |
| 108 | 106 | goto pending_qfail; |