• L
    Revert "net: ifb error path loop fix" · bcdddfb6
    Linus Torvalds 提交于
    This reverts commit 0c0b3ae6.
    
    Quoth David:
    
      "Jeff, please revert
    
       It's wrong.  We had a lengthy analysis of this piece of code
       several months ago, and it is correct.
    
       Consider, if we run the loop and we get an error
       the following happens:
    
       1) attempt of ifb_init_one(i) fails, therefore we should
          not try to "ifb_free_one()" on "i" since it failed
       2) the loop iteration first increments "i", then it
          check for error
    
       Therefore we must decrement "i" twice before the first
       free during the cleanup.  One to "undo" the for() loop
       increment, and one to "skip" the ifb_init_one() case which
       failed."
    Reported-by: NDavid Miller <davem@davemloft.net>
    Acked-by: NJeff Garzik <jgarzik@pobox.com>
    Cc: Andrew Morton <akpm@osdl.org>
    Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
    bcdddfb6
ifb.c 6.8 KB