sctp: avoid overwrite the return value of sctp_process_asconf_ack()
Subsystems (2)
PATCH 1/1 sctp: avoid overwrite the return value of sctp_process_asconf_ack()
The return value of sctp_process_asconf_ack() may be overwritten while process parameters with no error. This patch fixed the problem.
Signed-off-by Wei Yongjun <[email protected]>
--- net/sctp/sm_make_chunk.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
net/sctp/sm_make_chunk.c +2 -1
@@ -3271,7 +3271,8 @@ int sctp_process_asconf_ack(struct sctp_association *asoc,switch (err_code) {case SCTP_ERROR_NO_ERROR : - retval =sctp_asconf_param_success (asoc, asconf_param); +if (sctp_asconf_param_success (asoc, asconf_param)) + retval =1 ;break ;case SCTP_ERROR_RSRC_LOW :
Signature · 1 line
1.5.3.8
Quoted 14 lines · Wei Yongjun
The return value of
sctp_process_asconf_ack()may be overwritten while process parameters with no error. This patch fixed the problem.Signed-off-by Wei Yongjun <[email protected]>--- net/sctp/sm_make_chunk.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)net/sctp/sm_make_chunk.c +0
-0
net/sctp/sm_make_chunk.c int sctp_process_asconf_ack(struct sctp_association *asoc, · line 3278
Quoted 9 lines
net/sctp/sm_make_chunk.c +2
-1@@ -3271,7 +3271,8 @@ int sctp_process_asconf_ack(struct sctp_association *asoc,switch (err_code) {case SCTP_ERROR_NO_ERROR : - retval =sctp_asconf_param_success (asoc, asconf_param); +if (sctp_asconf_param_success (asoc, asconf_param)) + retval =1 ;break ;case SCTP_ERROR_RSRC_LOW :
Hmm... As long as you are cleaning up, looks like sctp_asconf_param_success can easily become a void and we avoid this whole thing. Right now, that function will never return 'TRUE'.
-vlad