diff options
author | David S. Miller <davem@davemloft.net> | 2016-10-03 03:17:07 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-10-03 04:20:41 +0200 |
commit | b50afd203a5ef1998c18d6519ad2b2c546d6af22 (patch) | |
tree | 608e6845e78a4ffe623c7cdf6581e29e2d9be0a9 /net/sctp/socket.c | |
parent | net: Use ns_capable_noaudit() when determining net sysctl permissions (diff) | |
parent | Linux 4.8 (diff) | |
download | linux-b50afd203a5ef1998c18d6519ad2b2c546d6af22.tar.xz linux-b50afd203a5ef1998c18d6519ad2b2c546d6af22.zip |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Three sets of overlapping changes. Nothing serious.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/socket.c')
-rw-r--r-- | net/sctp/socket.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c index 6cdc61c21438..fb02c7033307 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c @@ -4473,17 +4473,21 @@ int sctp_transport_lookup_process(int (*cb)(struct sctp_transport *, void *), const union sctp_addr *paddr, void *p) { struct sctp_transport *transport; - int err = 0; + int err = -ENOENT; rcu_read_lock(); transport = sctp_addrs_lookup_transport(net, laddr, paddr); if (!transport || !sctp_transport_hold(transport)) goto out; - err = cb(transport, p); + + sctp_association_hold(transport->asoc); sctp_transport_put(transport); -out: rcu_read_unlock(); + err = cb(transport, p); + sctp_association_put(transport->asoc); + +out: return err; } EXPORT_SYMBOL_GPL(sctp_transport_lookup_process); |