Re: [PATCH] net/sctp: always initialise sctp_ht_iter::start_fail

2016-07-23 Thread Marcelo Ricardo Leitner
On Sat, Jul 23, 2016 at 04:00:39PM +0200, Vegard Nossum wrote: > On 07/23/2016 03:39 PM, Marcelo Ricardo Leitner wrote: > > On Sat, Jul 23, 2016 at 11:52:23AM +0200, Vegard Nossum wrote: > > > seq_read() can call ->start() twice on the same iterator more than once > > > (e.g. once through traverse(

Re: [PATCH] net/sctp: always initialise sctp_ht_iter::start_fail

2016-07-23 Thread Vegard Nossum
On 07/23/2016 03:39 PM, Marcelo Ricardo Leitner wrote: On Sat, Jul 23, 2016 at 11:52:23AM +0200, Vegard Nossum wrote: seq_read() can call ->start() twice on the same iterator more than once (e.g. once through traverse() and once in seq_read() itself). But when traverse() returns the error, it

Re: [PATCH] net/sctp: always initialise sctp_ht_iter::start_fail

2016-07-23 Thread Marcelo Ricardo Leitner
On Sat, Jul 23, 2016 at 11:52:23AM +0200, Vegard Nossum wrote: > seq_read() can call ->start() twice on the same iterator more than once > (e.g. once through traverse() and once in seq_read() itself). But when traverse() returns the error, it goes to Done label, skipping the call to ->start() from

[PATCH] net/sctp: always initialise sctp_ht_iter::start_fail

2016-07-23 Thread Vegard Nossum
seq_read() can call ->start() twice on the same iterator more than once (e.g. once through traverse() and once in seq_read() itself). We should initialize sctp_ht_iter::start_fail to zero if ->start() succeeds, otherwise it's possible that we leave an old value of 1 there, which will cause ->stop(