Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <colin.king@canonical.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Colin Ian King and committed by
Herbert Xu
d80388ec 9bd82904

+1
+1
drivers/crypto/cavium/cpt/cptvf_main.c
··· 242 242 if (!curr->head) { 243 243 dev_err(&pdev->dev, "Command Q (%d) chunk (%d) allocation failed\n", 244 244 i, queue->nchunks); 245 + kfree(curr); 245 246 goto cmd_qfail; 246 247 } 247 248