diff options
author | Jani Nikula <jani.nikula@intel.com> | 2021-07-01 18:46:34 +0300 |
---|---|---|
committer | Jani Nikula <jani.nikula@intel.com> | 2021-07-01 18:46:34 +0300 |
commit | e42c6c1bc8d5e70d7b2c8af534b0d33a2be48f0c (patch) | |
tree | 4b1109adc051c943ef3edd990f5a907a0836bdf8 /net/rds/connection.c | |
parent | a03e880a700d9e217f7660bfc3616d93783b6d8c (diff) | |
parent | 8a02ea42bc1d4c448caf1bab0e05899dad503f74 (diff) | |
download | linux-e42c6c1bc8d5e70d7b2c8af534b0d33a2be48f0c.tar.xz |
Merge drm/drm-next into drm-intel-next
Bring drm-intel-next closer to drm-next and drm-intel-gt-next for a more
feasible baseline for topic branches.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Diffstat (limited to 'net/rds/connection.c')
-rw-r--r-- | net/rds/connection.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/net/rds/connection.c b/net/rds/connection.c index f2fcab182095..a3bc4b54d491 100644 --- a/net/rds/connection.c +++ b/net/rds/connection.c @@ -240,12 +240,23 @@ static struct rds_connection *__rds_conn_create(struct net *net, if (loop_trans) { rds_trans_put(loop_trans); conn->c_loopback = 1; - if (is_outgoing && trans->t_prefer_loopback) { - /* "outgoing" connection - and the transport - * says it wants the connection handled by the - * loopback transport. This is what TCP does. - */ - trans = &rds_loop_transport; + if (trans->t_prefer_loopback) { + if (likely(is_outgoing)) { + /* "outgoing" connection to local address. + * Protocol says it wants the connection + * handled by the loopback transport. + * This is what TCP does. + */ + trans = &rds_loop_transport; + } else { + /* No transport currently in use + * should end up here, but if it + * does, reset/destroy the connection. + */ + kmem_cache_free(rds_conn_slab, conn); + conn = ERR_PTR(-EOPNOTSUPP); + goto out; + } } } |