summaryrefslogtreecommitdiffstats
path: root/net/rds
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2019-02-08 15:00:17 -0800
committerDavid S. Miller <davem@davemloft.net>2019-02-08 15:00:17 -0800
commita655fe9f194842693258f43b5382855db1c2f654 (patch)
treea6e523c42378f43881c421530941dcbb529461ab /net/rds
parent7499a288bf1a4a49be9d72beb0a5c7b9aa6ffec9 (diff)
parent27b4ad621e887ce8e5eb508a0103f13d30f6b38a (diff)
downloadlinux-a655fe9f194842693258f43b5382855db1c2f654.tar.gz
linux-a655fe9f194842693258f43b5382855db1c2f654.tar.bz2
linux-a655fe9f194842693258f43b5382855db1c2f654.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
An ipvlan bug fix in 'net' conflicted with the abstraction away of the IPV6 specific support in 'net-next'. Similarly, a bug fix for mlx5 in 'net' conflicted with the flow action conversion in 'net-next'. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/rds')
-rw-r--r--net/rds/bind.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/rds/bind.c b/net/rds/bind.c
index 762d2c6788a3..17c9d9f0c848 100644
--- a/net/rds/bind.c
+++ b/net/rds/bind.c
@@ -78,10 +78,10 @@ struct rds_sock *rds_find_bound(const struct in6_addr *addr, __be16 port,
__rds_create_bind_key(key, addr, port, scope_id);
rcu_read_lock();
rs = rhashtable_lookup(&bind_hash_table, key, ht_parms);
- if (rs && !sock_flag(rds_rs_to_sk(rs), SOCK_DEAD))
- rds_sock_addref(rs);
- else
+ if (rs && (sock_flag(rds_rs_to_sk(rs), SOCK_DEAD) ||
+ !refcount_inc_not_zero(&rds_rs_to_sk(rs)->sk_refcnt)))
rs = NULL;
+
rcu_read_unlock();
rdsdebug("returning rs %p for %pI6c:%u\n", rs, addr,