From: Harsh Jain Date: Fri, 27 Jan 2017 10:39:07 +0000 (+0530) Subject: crypto: chcr - fix itnull.cocci warnings X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=ee3bd84f55d670961f36df332be299f3386b7690;p=openwrt%2Fstaging%2Fblogic.git crypto: chcr - fix itnull.cocci warnings The first argument to list_for_each_entry cannot be NULL. Generated by: scripts/coccinelle/iterators/itnull.cocci Signed-off-by: Julia Lawall Signed-off-by: Fengguang Wu Signed-off-by: Harsh Jain Signed-off-by: Herbert Xu --- diff --git a/drivers/crypto/chelsio/chcr_core.c b/drivers/crypto/chelsio/chcr_core.c index 1c65f07e1cc9..2bfd61ae5ad5 100644 --- a/drivers/crypto/chelsio/chcr_core.c +++ b/drivers/crypto/chelsio/chcr_core.c @@ -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;