Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965123AbbLRUHz (ORCPT ); Fri, 18 Dec 2015 15:07:55 -0500 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:36789 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932736AbbLRUHy (ORCPT ); Fri, 18 Dec 2015 15:07:54 -0500 X-IronPort-AV: E=Sophos;i="5.20,447,1444687200"; d="scan'208";a="193041129" Date: Fri, 18 Dec 2015 21:07:51 +0100 (CET) From: Julia Lawall X-X-Sender: jll@localhost6.localdomain6 To: Geliang Tang cc: Felipe Balbi , Greg Kroah-Hartman , Andrzej Pietrasiewicz , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, kbuild-all@01.org Subject: [PATCH] usb: gadget: rndis: fix itnull.cocci warnings Message-ID: User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 910 Lines: 28 The index variable of list_for_each_entry_safe is never NULL. Generated by: scripts/coccinelle/iterators/itnull.cocci CC: Geliang Tang Signed-off-by: Fengguang Wu Signed-off-by: Julia Lawall --- rndis.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/usb/gadget/function/rndis.c +++ b/drivers/usb/gadget/function/rndis.c @@ -1009,7 +1009,7 @@ void rndis_free_response(struct rndis_pa rndis_resp_t *r, *n; list_for_each_entry_safe(r, n, ¶ms->resp_queue, list) { - if (r && r->buf == buf) { + if (r->buf == buf) { list_del(&r->list); kfree(r); } -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/