mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Julia Lawall <julia.lawall@lip6.fr>
To: Geliang Tang <geliangtang@163.com>
Cc: linux-usb@vger.kernel.org, kbuild-all@01.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Felipe Balbi <balbi@ti.com>,
	Andrzej Pietrasiewicz <andrzej.p@samsung.com>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] usb: gadget: rndis: fix itnull.cocci warnings
Date: Mon, 25 Jan 2016 16:21:54 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.10.1601251619070.2510@hadrien> (raw)

The index variable of list_for_each_entry_safe is an offset from a list
pointer, and thus should not be NULL.

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

CC: Geliang Tang <geliangtang@163.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
usb-testing
head:   0e781c2258ffb2a42bf44f62dea8662f38cbfd34
commit: f6281af9d62e128aa6efad29cf7265062af114f2 [27/38] usb: gadget:
rndis: use list_for_each_entry_safe

 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, &params->resp_queue, list) {
-		if (r && r->buf == buf) {
+		if (r->buf == buf) {
 			list_del(&r->list);
 			kfree(r);
 		}

             reply	other threads:[~2016-01-25 15:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-25 15:21 Julia Lawall [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-12-18 20:07 Julia Lawall
2015-12-22 18:10 ` Felipe Balbi
2015-12-22 18:17   ` Julia Lawall
2015-12-22 18:28     ` Felipe Balbi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.10.1601251619070.2510@hadrien \
    --to=julia.lawall@lip6.fr \
    --cc=andrzej.p@samsung.com \
    --cc=balbi@ti.com \
    --cc=geliangtang@163.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kbuild-all@01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®