Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1295119

[PATCH] usb: gadget: rndis: fix itnull.cocci warnings

From Julia Lawall <julia.lawall@lip6.fr>
Newsgroups linux.kernel
Subject [PATCH] usb: gadget: rndis: fix itnull.cocci warnings
Date 2015-12-18 21:10 +0100
Message-ID <qH9vI-1NI-17@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


The index variable of list_for_each_entry_safe is never 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>
---

 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);
 		}
--
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/

Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

[PATCH] usb: gadget: rndis: fix itnull.cocci warnings Julia Lawall <julia.lawall@lip6.fr> - 2015-12-18 21:10 +0100
  Re: [PATCH] usb: gadget: rndis: fix itnull.cocci warnings Felipe Balbi <balbi@ti.com> - 2015-12-22 19:20 +0100
    Re: [PATCH] usb: gadget: rndis: fix itnull.cocci warnings Julia Lawall <julia.lawall@lip6.fr> - 2015-12-22 19:20 +0100
      Re: [PATCH] usb: gadget: rndis: fix itnull.cocci warnings Felipe Balbi <balbi@ti.com> - 2015-12-22 19:30 +0100

csiph-web