The first argument to list_for_each_entry cannot be NULL. Generated by: scripts/coccinelle/iterators/itnull.cocci
CC: Harsh Jain <ha...@chelsio.com> Signed-off-by: Julia Lawall <julia.law...@lip6.fr> Signed-off-by: Fengguang Wu <fengguang...@intel.com> --- This code comes from the following git tree: url: https://github.com/0day-ci/linux/commits/Harsh-Jain/crypto-chcr-Bug-fixes/20170107-093356 base: https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master In-Reply-To: <8e0086b56d8fb61637d179c32a09a1bca03c4186.1483599449.git.ha...@chelsio.com> chcr_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- 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 * */ 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;