]> git.baikalelectronics.ru Git - kernel.git/commit
sctp: fix some rhashtable functions using in sctp proc/diag
authorXin Long <lucien.xin@gmail.com>
Thu, 14 Apr 2016 07:35:35 +0000 (15:35 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 15 Apr 2016 21:29:37 +0000 (17:29 -0400)
commit65ea1564bcf9ccebe099416b2eb48bdd7fa2fe21
treed8a03375bdd9433670e8d16db957462a480c83fa
parentac0927b8d3fa844964f5e5c8b4359caed5da71fd
sctp: fix some rhashtable functions using in sctp proc/diag

When rhashtable_walk_init return err, no release function should be
called, and when rhashtable_walk_start return err, we should only invoke
rhashtable_walk_exit to release the source.

But now when sctp_transport_walk_start return err, we just call
rhashtable_walk_stop/exit, and never care about if rhashtable_walk_init
or start return err, which is so bad.

We will fix it by calling rhashtable_walk_exit if rhashtable_walk_start
return err in sctp_transport_walk_start, and if sctp_transport_walk_start
return err, we do not need to call sctp_transport_walk_stop any more.

For sctp proc, we will use 'iter->start_fail' to decide if we will call
rhashtable_walk_stop/exit.

Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sctp/proc.c
net/sctp/socket.c