diff options
author | David S. Miller <davem@davemloft.net> | 2012-07-19 20:17:30 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-07-19 20:17:30 +0200 |
commit | abaa72d7fd9a20a67b62e6afa0e746e27851dc33 (patch) | |
tree | ebe4134fcc93a6e205e6004b3e652d7a62281651 /net/sctp | |
parent | net-tcp: Fast Open client - cookie-less mode (diff) | |
parent | Merge tag 'md-3.5-fixes' of git://neil.brown.name/md (diff) | |
download | linux-abaa72d7fd9a20a67b62e6afa0e746e27851dc33.tar.xz linux-abaa72d7fd9a20a67b62e6afa0e746e27851dc33.zip |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts:
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
Diffstat (limited to 'net/sctp')
-rw-r--r-- | net/sctp/input.c | 7 | ||||
-rw-r--r-- | net/sctp/socket.c | 12 |
2 files changed, 12 insertions, 7 deletions
diff --git a/net/sctp/input.c b/net/sctp/input.c index c201b26879a1..e64d5210ed13 100644 --- a/net/sctp/input.c +++ b/net/sctp/input.c @@ -752,15 +752,12 @@ static void __sctp_unhash_endpoint(struct sctp_endpoint *ep) epb = &ep->base; - if (hlist_unhashed(&epb->node)) - return; - epb->hashent = sctp_ep_hashfn(epb->bind_addr.port); head = &sctp_ep_hashtable[epb->hashent]; sctp_write_lock(&head->lock); - __hlist_del(&epb->node); + hlist_del_init(&epb->node); sctp_write_unlock(&head->lock); } @@ -841,7 +838,7 @@ static void __sctp_unhash_established(struct sctp_association *asoc) head = &sctp_assoc_hashtable[epb->hashent]; sctp_write_lock(&head->lock); - __hlist_del(&epb->node); + hlist_del_init(&epb->node); sctp_write_unlock(&head->lock); } diff --git a/net/sctp/socket.c b/net/sctp/socket.c index 74bd3c47350a..5d488cdcf679 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c @@ -1231,8 +1231,14 @@ out_free: SCTP_DEBUG_PRINTK("About to exit __sctp_connect() free asoc: %p" " kaddrs: %p err: %d\n", asoc, kaddrs, err); - if (asoc) + if (asoc) { + /* sctp_primitive_ASSOCIATE may have added this association + * To the hash table, try to unhash it, just in case, its a noop + * if it wasn't hashed so we're safe + */ + sctp_unhash_established(asoc); sctp_association_free(asoc); + } return err; } @@ -1942,8 +1948,10 @@ SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk, goto out_unlock; out_free: - if (new_asoc) + if (new_asoc) { + sctp_unhash_established(asoc); sctp_association_free(asoc); + } out_unlock: sctp_release_sock(sk); |