2015-12-18 20:07:55

by Julia Lawall

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

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

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


2015-12-22 18:11:23

by Felipe Balbi

[permalink] [raw]
Subject: Re: [PATCH] usb: gadget: rndis: fix itnull.cocci warnings

Julia Lawall <[email protected]> writes:

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

doesn't apply. Does this depend on anything ?

--
balbi


Attachments:
signature.asc (818.00 B)

2015-12-22 18:18:04

by Julia Lawall

[permalink] [raw]
Subject: Re: [PATCH] usb: gadget: rndis: fix itnull.cocci warnings



On Tue, 22 Dec 2015, Felipe Balbi wrote:

> Julia Lawall <[email protected]> writes:
>
> > The index variable of list_for_each_entry_safe is never 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]>
>
> doesn't apply. Does this depend on anything ?

It may be derived from a patch posted to a mailing list. I don't have the
original reference any more.

julia

2015-12-22 18:28:57

by Felipe Balbi

[permalink] [raw]
Subject: Re: [PATCH] usb: gadget: rndis: fix itnull.cocci warnings


Hi,

Julia Lawall <[email protected]> writes:
> On Tue, 22 Dec 2015, Felipe Balbi wrote:
>
>> Julia Lawall <[email protected]> writes:
>>
>> > The index variable of list_for_each_entry_safe is never 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]>
>>
>> doesn't apply. Does this depend on anything ?
>
> It may be derived from a patch posted to a mailing list. I don't have the
> original reference any more.

okay, it could be the big series converting gadgets to
list_for_each_entry_safe(). Thanks

--
balbi


Attachments:
signature.asc (818.00 B)