Skip to content

Commit

Permalink
usb: gadget: rndis: fix itnull.cocci warnings
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Fengguang Wu <[email protected]>
Signed-off-by: Julia Lawall <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
JuliaLawall authored and gregkh committed Feb 3, 2016
1 parent b4a90d0 commit 1c17a35
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/usb/gadget/function/rndis.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 1c17a35

Please sign in to comment.