sctp: rework switch cases in sctp_outq_flush_data
authorMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Mon, 14 May 2018 17:34:43 +0000 (14:34 -0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 15 May 2018 02:57:15 +0000 (22:57 -0400)
commit4fdbb0efb9de51295071fdf968d476c1f0605d21
tree97b8c17a71566857c739a0519dbbb8cafbc902e9
parent6605f694823965fe53ce761dad3aaf965861dc7e
sctp: rework switch cases in sctp_outq_flush_data

Remove an inner one, which tended to be error prone due to the cascading
and it can be replaced by a simple if ().

Rework the outer one so that the actual flush code is not inside it. Now
we first validate if we can or cannot send data, return if not, and then
the flush code.

Suggested-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sctp/outqueue.c