提交 d80388ec 编写于 作者: C Colin Ian King 提交者: Herbert Xu

crypto: cavium - fix leak on curr if curr->head fails to be allocated

The exit path when curr->head cannot be allocated fails to kfree the
earlier allocated curr.  Fix this by kfree'ing it.
Signed-off-by: NColin Ian King <colin.king@canonical.com>
Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
上级 9bd82904
...@@ -242,6 +242,7 @@ static int alloc_command_queues(struct cpt_vf *cptvf, ...@@ -242,6 +242,7 @@ static int alloc_command_queues(struct cpt_vf *cptvf,
if (!curr->head) { if (!curr->head) {
dev_err(&pdev->dev, "Command Q (%d) chunk (%d) allocation failed\n", dev_err(&pdev->dev, "Command Q (%d) chunk (%d) allocation failed\n",
i, queue->nchunks); i, queue->nchunks);
kfree(curr);
goto cmd_qfail; goto cmd_qfail;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册