Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d80388ec authored by Colin Ian King's avatar Colin Ian King Committed by Herbert Xu
Browse files

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: default avatarColin Ian King <colin.king@canonical.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 9bd82904
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -242,6 +242,7 @@ static int alloc_command_queues(struct cpt_vf *cptvf,
			if (!curr->head) {
				dev_err(&pdev->dev, "Command Q (%d) chunk (%d) allocation failed\n",
					i, queue->nchunks);
				kfree(curr);
				goto cmd_qfail;
			}