aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp
diff options
context:
space:
mode:
Diffstat (limited to 'net/sctp')
-rw-r--r--net/sctp/proc.c12
-rw-r--r--net/sctp/sm_sideeffect.c5
2 files changed, 13 insertions, 4 deletions
diff --git a/net/sctp/proc.c b/net/sctp/proc.c
index 4e45ee35d0db..0c83162a6bf8 100644
--- a/net/sctp/proc.c
+++ b/net/sctp/proc.c
@@ -134,9 +134,15 @@ static void sctp_seq_dump_local_addrs(struct seq_file *seq, struct sctp_ep_commo
134 struct sctp_af *af; 134 struct sctp_af *af;
135 135
136 if (epb->type == SCTP_EP_TYPE_ASSOCIATION) { 136 if (epb->type == SCTP_EP_TYPE_ASSOCIATION) {
137 asoc = sctp_assoc(epb); 137 asoc = sctp_assoc(epb);
138 peer = asoc->peer.primary_path; 138
139 primary = &peer->saddr; 139 peer = asoc->peer.primary_path;
140 if (unlikely(peer == NULL)) {
141 WARN(1, "Association %p with NULL primary path!", asoc);
142 return;
143 }
144
145 primary = &peer->saddr;
140 } 146 }
141 147
142 rcu_read_lock(); 148 rcu_read_lock();
diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c
index 8aab894aeabe..ff91f47b0239 100644
--- a/net/sctp/sm_sideeffect.c
+++ b/net/sctp/sm_sideeffect.c
@@ -864,6 +864,7 @@ static void sctp_cmd_delete_tcb(sctp_cmd_seq_t *cmds,
864 (!asoc->temp) && (sk->sk_shutdown != SHUTDOWN_MASK)) 864 (!asoc->temp) && (sk->sk_shutdown != SHUTDOWN_MASK))
865 return; 865 return;
866 866
867 BUG_ON(asoc->peer.primary_path == NULL);
867 sctp_unhash_established(asoc); 868 sctp_unhash_established(asoc);
868 sctp_association_free(asoc); 869 sctp_association_free(asoc);
869} 870}
@@ -1274,8 +1275,10 @@ static int sctp_cmd_interpreter(sctp_event_t event_type,
1274 sctp_outq_uncork(&asoc->outqueue); 1275 sctp_outq_uncork(&asoc->outqueue);
1275 local_cork = 0; 1276 local_cork = 0;
1276 } 1277 }
1277 asoc = cmd->obj.asoc; 1278
1278 /* Register with the endpoint. */ 1279 /* Register with the endpoint. */
1280 asoc = cmd->obj.asoc;
1281 BUG_ON(asoc->peer.primary_path == NULL);
1279 sctp_endpoint_add_asoc(ep, asoc); 1282 sctp_endpoint_add_asoc(ep, asoc);
1280 sctp_hash_established(asoc); 1283 sctp_hash_established(asoc);
1281 break; 1284 break;