On 01/11/2017 08:19 PM, Parthasarathy Bhuvaragan wrote:
> In tipc_server_stop(), we iterate over the connections with limiting
> factor as server's idr_in_use. We ignore the fact that this variable
> is decremented in tipc_close_conn(), leading to premature exit.
>
> In this commit, we iterate until the we have no connections left.
>
> Signed-off-by: Parthasarathy Bhuvaragan 
> <parthasarathy.bhuvara...@ericsson.com>

Acked-by: Ying Xue <ying....@windriver.com>

> ---
>  net/tipc/server.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/net/tipc/server.c b/net/tipc/server.c
> index fa54a2760ee0..ad455f128925 100644
> --- a/net/tipc/server.c
> +++ b/net/tipc/server.c
> @@ -617,14 +617,12 @@ int tipc_server_start(struct tipc_server *s)
>  void tipc_server_stop(struct tipc_server *s)
>  {
>       struct tipc_conn *con;
> -     int total = 0;
>       int id;
>
>       spin_lock_bh(&s->idr_lock);
> -     for (id = 0; total < s->idr_in_use; id++) {
> +     for (id = 0; s->idr_in_use; id++) {
>               con = idr_find(&s->conn_idr, id);
>               if (con) {
> -                     total++;
>                       spin_unlock_bh(&s->idr_lock);
>                       tipc_close_conn(con);
>                       spin_lock_bh(&s->idr_lock);
>


------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
tipc-discussion mailing list
tipc-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tipc-discussion

Reply via email to