diff options
Diffstat (limited to 'net/sctp/socket.c')
-rw-r--r-- | net/sctp/socket.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c index 318c6786d653..1b5d669e3029 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c | |||
@@ -235,8 +235,12 @@ static struct sctp_transport *sctp_addr_id2transport(struct sock *sk, | |||
235 | sctp_assoc_t id) | 235 | sctp_assoc_t id) |
236 | { | 236 | { |
237 | struct sctp_association *addr_asoc = NULL, *id_asoc = NULL; | 237 | struct sctp_association *addr_asoc = NULL, *id_asoc = NULL; |
238 | struct sctp_transport *transport; | 238 | struct sctp_af *af = sctp_get_af_specific(addr->ss_family); |
239 | union sctp_addr *laddr = (union sctp_addr *)addr; | 239 | union sctp_addr *laddr = (union sctp_addr *)addr; |
240 | struct sctp_transport *transport; | ||
241 | |||
242 | if (!af || sctp_verify_addr(sk, laddr, af->sockaddr_len)) | ||
243 | return NULL; | ||
240 | 244 | ||
241 | addr_asoc = sctp_endpoint_lookup_assoc(sctp_sk(sk)->ep, | 245 | addr_asoc = sctp_endpoint_lookup_assoc(sctp_sk(sk)->ep, |
242 | laddr, | 246 | laddr, |
@@ -7422,7 +7426,8 @@ static int sctp_wait_for_sndbuf(struct sctp_association *asoc, long *timeo_p, | |||
7422 | */ | 7426 | */ |
7423 | release_sock(sk); | 7427 | release_sock(sk); |
7424 | current_timeo = schedule_timeout(current_timeo); | 7428 | current_timeo = schedule_timeout(current_timeo); |
7425 | BUG_ON(sk != asoc->base.sk); | 7429 | if (sk != asoc->base.sk) |
7430 | goto do_error; | ||
7426 | lock_sock(sk); | 7431 | lock_sock(sk); |
7427 | 7432 | ||
7428 | *timeo_p = current_timeo; | 7433 | *timeo_p = current_timeo; |