aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp/sm_make_chunk.c
diff options
context:
space:
mode:
authorWei Yongjun <yjwei@cn.fujitsu.com>2009-06-16 02:47:30 -0400
committerVlad Yasevich <vladislav.yasevich@hp.com>2009-09-04 18:20:54 -0400
commit425e0f685230986511b1fdf80340e2f28b214c5d (patch)
tree1af69aff245f3930efdf39d08099a339f27305dd /net/sctp/sm_make_chunk.c
parent8a34e2f8ba7d4302977c90e357921994a6c39af9 (diff)
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 <yjwei@cn.fujitsu.com> Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Diffstat (limited to 'net/sctp/sm_make_chunk.c')
-rw-r--r--net/sctp/sm_make_chunk.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
index 61cc6075b0df..b7acc9ca793a 100644
--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -3104,7 +3104,7 @@ done:
3104} 3104}
3105 3105
3106/* Process a asconf parameter that is successfully acked. */ 3106/* Process a asconf parameter that is successfully acked. */
3107static int sctp_asconf_param_success(struct sctp_association *asoc, 3107static void sctp_asconf_param_success(struct sctp_association *asoc,
3108 sctp_addip_param_t *asconf_param) 3108 sctp_addip_param_t *asconf_param)
3109{ 3109{
3110 struct sctp_af *af; 3110 struct sctp_af *af;
@@ -3113,7 +3113,6 @@ static int sctp_asconf_param_success(struct sctp_association *asoc,
3113 union sctp_addr_param *addr_param; 3113 union sctp_addr_param *addr_param;
3114 struct sctp_transport *transport; 3114 struct sctp_transport *transport;
3115 struct sctp_sockaddr_entry *saddr; 3115 struct sctp_sockaddr_entry *saddr;
3116 int retval = 0;
3117 3116
3118 addr_param = (union sctp_addr_param *) 3117 addr_param = (union sctp_addr_param *)
3119 ((void *)asconf_param + sizeof(sctp_addip_param_t)); 3118 ((void *)asconf_param + sizeof(sctp_addip_param_t));
@@ -3136,7 +3135,7 @@ static int sctp_asconf_param_success(struct sctp_association *asoc,
3136 break; 3135 break;
3137 case SCTP_PARAM_DEL_IP: 3136 case SCTP_PARAM_DEL_IP:
3138 local_bh_disable(); 3137 local_bh_disable();
3139 retval = sctp_del_bind_addr(bp, &addr); 3138 sctp_del_bind_addr(bp, &addr);
3140 local_bh_enable(); 3139 local_bh_enable();
3141 list_for_each_entry(transport, &asoc->peer.transport_addr_list, 3140 list_for_each_entry(transport, &asoc->peer.transport_addr_list,
3142 transports) { 3141 transports) {
@@ -3148,8 +3147,6 @@ static int sctp_asconf_param_success(struct sctp_association *asoc,
3148 default: 3147 default:
3149 break; 3148 break;
3150 } 3149 }
3151
3152 return retval;
3153} 3150}
3154 3151
3155/* Get the corresponding ASCONF response error code from the ASCONF_ACK chunk 3152/* Get the corresponding ASCONF response error code from the ASCONF_ACK chunk
@@ -3266,7 +3263,7 @@ int sctp_process_asconf_ack(struct sctp_association *asoc,
3266 3263
3267 switch (err_code) { 3264 switch (err_code) {
3268 case SCTP_ERROR_NO_ERROR: 3265 case SCTP_ERROR_NO_ERROR:
3269 retval = sctp_asconf_param_success(asoc, asconf_param); 3266 sctp_asconf_param_success(asoc, asconf_param);
3270 break; 3267 break;
3271 3268
3272 case SCTP_ERROR_RSRC_LOW: 3269 case SCTP_ERROR_RSRC_LOW: