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

crypto: ixp4xx - Add missing npe_c release in error branches

Most error branches following the call to npe_request contain a call to
npe_request. This patch add a call to npe_release to error branches
following the call to npe_request that do not have it.

This issue was found with Hector.

Signed-off-by: Quentin Lambert <lambert.quentin@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Quentin Lambert and committed by
Herbert Xu
c5736a40 b363700e

+4 -2
+4 -2
drivers/crypto/ixp4xx_crypto.c
··· 448 448 if (!npe_running(npe_c)) { 449 449 ret = npe_load_firmware(npe_c, npe_name(npe_c), dev); 450 450 if (ret) 451 - return ret; 451 + goto npe_release; 452 452 if (npe_recv_message(npe_c, msg, "STATUS_MSG")) 453 453 goto npe_error; 454 454 } else { ··· 472 472 default: 473 473 printk(KERN_ERR "Firmware of %s lacks crypto support\n", 474 474 npe_name(npe_c)); 475 - return -ENODEV; 475 + ret = -ENODEV; 476 + goto npe_release; 476 477 } 477 478 /* buffer_pool will also be used to sometimes store the hmac, 478 479 * so assure it is large enough ··· 512 511 err: 513 512 dma_pool_destroy(ctx_pool); 514 513 dma_pool_destroy(buffer_pool); 514 + npe_release: 515 515 npe_release(npe_c); 516 516 return ret; 517 517 }