diff options
author | Harsh Jain <harsh@chelsio.com> | 2017-01-27 13:39:12 +0300 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2017-02-03 13:16:16 +0300 |
commit | 5ba042c094f9438d9441ab5f8ba75f0d121df0a1 (patch) | |
tree | 32f1f221e5867f7652c3d7322161c62b33bec90b /drivers/crypto/chelsio | |
parent | d2826056cb5e4b4ddc90227b509473f71e15f011 (diff) | |
download | linux-5ba042c094f9438d9441ab5f8ba75f0d121df0a1.tar.xz |
crypto: chcr - Fix Smatch Complaint
Initialise variable after null check.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Harsh Jain <harsh@chelsio.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/chelsio')
-rwxr-xr-x[-rw-r--r--] | drivers/crypto/chelsio/chcr_algo.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/crypto/chelsio/chcr_algo.c b/drivers/crypto/chelsio/chcr_algo.c index 21fc04c6f272..41bc7f4f58cd 100644..100755 --- a/drivers/crypto/chelsio/chcr_algo.c +++ b/drivers/crypto/chelsio/chcr_algo.c @@ -2456,13 +2456,14 @@ static int chcr_aead_op(struct aead_request *req, { struct crypto_aead *tfm = crypto_aead_reqtfm(req); struct chcr_context *ctx = crypto_aead_ctx(tfm); - struct uld_ctx *u_ctx = ULD_CTX(ctx); + struct uld_ctx *u_ctx; struct sk_buff *skb; - if (ctx && !ctx->dev) { + if (!ctx->dev) { pr_err("chcr : %s : No crypto device.\n", __func__); return -ENXIO; } + u_ctx = ULD_CTX(ctx); if (cxgb4_is_crypto_q_full(u_ctx->lldi.ports[0], ctx->tx_channel_id)) { if (!(req->base.flags & CRYPTO_TFM_REQ_MAY_BACKLOG)) |