Re: [PATCH v2] staging: vchiq: Fix list_for_each exit tests

2020-10-08 Thread Nicolas Saenz Julienne
On Tue, 2020-10-06 at 16:47 +0300, Dan Carpenter wrote: > After a list_for_each_entry() loop, the list iterator is always non-NULL > so these conditions don't work. If the "waiter" is not found then this > results in an out of bounds access. > > I have fixed it by introducing a new "found"

[PATCH v2] staging: vchiq: Fix list_for_each exit tests

2020-10-06 Thread Dan Carpenter
After a list_for_each_entry() loop, the list iterator is always non-NULL so these conditions don't work. If the "waiter" is not found then this results in an out of bounds access. I have fixed it by introducing a new "found" variable. In one case, I used an else statement for readability.