crypto: chcr - fix itnull.cocci warnings
authorHarsh Jain <harsh@chelsio.com>
Fri, 27 Jan 2017 10:39:07 +0000 (16:09 +0530)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 3 Feb 2017 10:16:15 +0000 (18:16 +0800)
The first argument to list_for_each_entry cannot be NULL.

Generated by: scripts/coccinelle/iterators/itnull.cocci

Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Harsh Jain <harsh@chelsio.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/chelsio/chcr_core.c

index 1c65f07e1cc9a56f9dc88b30c10ba57e13b875ed..2bfd61ae5ad594b1c5f01b096d443ac636639c7a 100644 (file)
@@ -61,7 +61,7 @@ int assign_chcr_device(struct chcr_dev **dev)
         */
        mutex_lock(&dev_mutex); /* TODO ? */
        list_for_each_entry(u_ctx, &uld_ctx_list, entry)
-               if (u_ctx && u_ctx->dev) {
+               if (u_ctx->dev) {
                        *dev = u_ctx->dev;
                        ret = 0;
                        break;