提交 61a13714 编写于 作者: G Gustavo A. R. Silva 提交者: Herbert Xu

crypto: cavium - Use kcalloc() instead of kzalloc()

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

Link: https://github.com/KSPP/linux/issues/162Signed-off-by: NGustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: NKees Cook <keescook@chromium.org>
Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
上级 3d725965
...@@ -104,17 +104,14 @@ static int alloc_pending_queues(struct pending_qinfo *pqinfo, u32 qlen, ...@@ -104,17 +104,14 @@ static int alloc_pending_queues(struct pending_qinfo *pqinfo, u32 qlen,
u32 nr_queues) u32 nr_queues)
{ {
u32 i; u32 i;
size_t size;
int ret; int ret;
struct pending_queue *queue = NULL; struct pending_queue *queue = NULL;
pqinfo->nr_queues = nr_queues; pqinfo->nr_queues = nr_queues;
pqinfo->qlen = qlen; pqinfo->qlen = qlen;
size = (qlen * sizeof(struct pending_entry));
for_each_pending_queue(pqinfo, queue, i) { for_each_pending_queue(pqinfo, queue, i) {
queue->head = kzalloc((size), GFP_KERNEL); queue->head = kcalloc(qlen, sizeof(*queue->head), GFP_KERNEL);
if (!queue->head) { if (!queue->head) {
ret = -ENOMEM; ret = -ENOMEM;
goto pending_qfail; goto pending_qfail;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册