From: Harsh Jain Date: Fri, 27 Jan 2017 10:39:12 +0000 (+0530) Subject: crypto: chcr - Fix Smatch Complaint X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5ba042c094f9438d9441ab5f8ba75f0d121df0a1;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git crypto: chcr - Fix Smatch Complaint Initialise variable after null check. Reported-by: Dan Carpenter Signed-off-by: Harsh Jain Signed-off-by: Herbert Xu --- diff --git a/drivers/crypto/chelsio/chcr_algo.c b/drivers/crypto/chelsio/chcr_algo.c old mode 100644 new mode 100755 index 21fc04c6f272..41bc7f4f58cd --- 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))