Skip to content

Commit

Permalink
crypto: ixp4xx - Add missing npe_c release in error branches
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
Quentin Lambert authored and herbertx committed Aug 9, 2016
1 parent b363700 commit c5736a4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/crypto/ixp4xx_crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ static int init_ixp_crypto(struct device *dev)
if (!npe_running(npe_c)) {
ret = npe_load_firmware(npe_c, npe_name(npe_c), dev);
if (ret)
return ret;
goto npe_release;
if (npe_recv_message(npe_c, msg, "STATUS_MSG"))
goto npe_error;
} else {
Expand All @@ -472,7 +472,8 @@ static int init_ixp_crypto(struct device *dev)
default:
printk(KERN_ERR "Firmware of %s lacks crypto support\n",
npe_name(npe_c));
return -ENODEV;
ret = -ENODEV;
goto npe_release;
}
/* buffer_pool will also be used to sometimes store the hmac,
* so assure it is large enough
Expand Down Expand Up @@ -511,6 +512,7 @@ static int init_ixp_crypto(struct device *dev)
err:
dma_pool_destroy(ctx_pool);
dma_pool_destroy(buffer_pool);
npe_release:
npe_release(npe_c);
return ret;
}
Expand Down

0 comments on commit c5736a4

Please sign in to comment.