Commit 1c17a353 authored by Julia Lawall's avatar Julia Lawall Committed by Greg Kroah-Hartman

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: default avatarFengguang Wu <fengguang.wu@intel.com>
Signed-off-by: default avatarJulia Lawall <julia.lawall@lip6.fr>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b4a90d04
......@@ -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, &params->resp_queue, list) {
if (r && r->buf == buf) {
if (r->buf == buf) {
list_del(&r->list);
kfree(r);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment