diff options
author | Julia Lawall <julia.lawall@lip6.fr> | 2016-01-25 16:21:54 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-02-03 13:36:04 -0800 |
commit | 1c17a353c5a8346b1ce128c60ffb862d156f7e7e (patch) | |
tree | d48dbfd596cd45f4e6baa5a2c6688014efbe8403 | |
parent | b4a90d04ac79349799f65dfd7fa30b2aac6b2a4d (diff) | |
download | linux-1c17a353c5a8346b1ce128c60ffb862d156f7e7e.tar.gz linux-1c17a353c5a8346b1ce128c60ffb862d156f7e7e.tar.bz2 linux-1c17a353c5a8346b1ce128c60ffb862d156f7e7e.zip |
usb: gadget: rndis: fix itnull.cocci warnings
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/usb/gadget/function/rndis.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/gadget/function/rndis.c b/drivers/usb/gadget/function/rndis.c index 34a76db2c8fd..943c21aafd3b 100644 --- a/drivers/usb/gadget/function/rndis.c +++ b/drivers/usb/gadget/function/rndis.c @@ -1009,7 +1009,7 @@ void rndis_free_response(struct rndis_params *params, u8 *buf) 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); } |