Skip to content

Commit d80388e

Browse files
Colin Ian Kingherbertx
authored andcommitted
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: Colin Ian King <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent 9bd8290 commit d80388e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/crypto/cavium/cpt/cptvf_main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ static int alloc_command_queues(struct cpt_vf *cptvf,
242242
if (!curr->head) {
243243
dev_err(&pdev->dev, "Command Q (%d) chunk (%d) allocation failed\n",
244244
i, queue->nchunks);
245+
kfree(curr);
245246
goto cmd_qfail;
246247
}
247248

0 commit comments

Comments
 (0)