On 02/09/2016 03:11 PM, Rasmus Villemoes wrote:
> The while loop after err_slaves should use post-decrement; otherwise
> we'll fail to do the kfrees for i==0, and will run into out-of-bounds
> accesses if the setup above failed already at i==0.
>
> The predecrement in the --port is ok, since ->vla
Ouch! Egg on my face! Sorry about that.
You are correct! while (--i >= 0) IS exactly equivalent to
while (i--). (the while condition is fully evaluated before the loop is
entered; pre or post increment only influences which value is tested
for true in the while condition -- the pre-value (with p
On Wed, 10 Feb 2016 19:15:20 +0100
Rasmus Villemoes wrote:
> On Wed, Feb 10 2016, Yishai Hadas wrote:
>
> >> @@ -2429,7 +2429,7 @@ err_thread:
> >>flush_workqueue(priv->mfunc.master.comm_wq);
> >>destroy_workqueue(priv->mfunc.master.comm_wq);
> >> err_slaves:
> >> - while (--i) {
> >
On Wed, Feb 10 2016, Yishai Hadas wrote:
>> @@ -2429,7 +2429,7 @@ err_thread:
>> flush_workqueue(priv->mfunc.master.comm_wq);
>> destroy_workqueue(priv->mfunc.master.comm_wq);
>> err_slaves:
>> -while (--i) {
>> +while (i--) {
>
> This fix is wrong as it hits the case that i a
On 2/9/2016 10:11 PM, Rasmus Villemoes wrote:
The while loop after err_slaves should use post-decrement; otherwise
we'll fail to do the kfrees for i==0, and will run into out-of-bounds
accesses if the setup above failed already at i==0.
The predecrement in the --port is ok, since ->vlan_filter i
The while loop after err_slaves should use post-decrement; otherwise
we'll fail to do the kfrees for i==0, and will run into out-of-bounds
accesses if the setup above failed already at i==0.
The predecrement in the --port is ok, since ->vlan_filter is
(bizarrely) 1-indexed. But I'm changing 'if' t