diff options
-rw-r--r-- | net/sctp/proc.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/net/sctp/proc.c b/net/sctp/proc.c index 684c5b31563b..c74a810150aa 100644 --- a/net/sctp/proc.c +++ b/net/sctp/proc.c | |||
@@ -380,6 +380,8 @@ static int sctp_assocs_seq_show(struct seq_file *seq, void *v) | |||
380 | } | 380 | } |
381 | 381 | ||
382 | transport = (struct sctp_transport *)v; | 382 | transport = (struct sctp_transport *)v; |
383 | if (!sctp_transport_hold(transport)) | ||
384 | return 0; | ||
383 | assoc = transport->asoc; | 385 | assoc = transport->asoc; |
384 | epb = &assoc->base; | 386 | epb = &assoc->base; |
385 | sk = epb->sk; | 387 | sk = epb->sk; |
@@ -412,6 +414,8 @@ static int sctp_assocs_seq_show(struct seq_file *seq, void *v) | |||
412 | sk->sk_rcvbuf); | 414 | sk->sk_rcvbuf); |
413 | seq_printf(seq, "\n"); | 415 | seq_printf(seq, "\n"); |
414 | 416 | ||
417 | sctp_transport_put(transport); | ||
418 | |||
415 | return 0; | 419 | return 0; |
416 | } | 420 | } |
417 | 421 | ||
@@ -489,6 +493,8 @@ static int sctp_remaddr_seq_show(struct seq_file *seq, void *v) | |||
489 | } | 493 | } |
490 | 494 | ||
491 | tsp = (struct sctp_transport *)v; | 495 | tsp = (struct sctp_transport *)v; |
496 | if (!sctp_transport_hold(tsp)) | ||
497 | return 0; | ||
492 | assoc = tsp->asoc; | 498 | assoc = tsp->asoc; |
493 | 499 | ||
494 | list_for_each_entry_rcu(tsp, &assoc->peer.transport_addr_list, | 500 | list_for_each_entry_rcu(tsp, &assoc->peer.transport_addr_list, |
@@ -544,6 +550,8 @@ static int sctp_remaddr_seq_show(struct seq_file *seq, void *v) | |||
544 | seq_printf(seq, "\n"); | 550 | seq_printf(seq, "\n"); |
545 | } | 551 | } |
546 | 552 | ||
553 | sctp_transport_put(tsp); | ||
554 | |||
547 | return 0; | 555 | return 0; |
548 | } | 556 | } |
549 | 557 | ||