summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2019-10-25 19:18:21 -0700
committerDavid S. Miller <davem@davemloft.net>2019-10-25 19:18:21 -0700
commit31af5057c2c5668910b9e655f5e0fb9813351ff0 (patch)
tree0acb73be9354c41816a62e3b01fb34d94ba5f203
parent91e2e57636f163837e1aea2ce6c4995b8a2a6f10 (diff)
parentca5f8d2dd5229ccacdd5cfde1ce4d32b0810e454 (diff)
Merge branch 'smc-fixes'
Karsten Graul says: ==================== net/smc: fixes for -net Fixes for the net tree, covering a memleak when closing SMC fallback sockets and fix SMC-R connection establishment when vlan-ids are used. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/smc/af_smc.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c
index 5b932583e407..cea3c36ea0da 100644
--- a/net/smc/af_smc.c
+++ b/net/smc/af_smc.c
@@ -123,6 +123,12 @@ struct proto smc_proto6 = {
};
EXPORT_SYMBOL_GPL(smc_proto6);
+static void smc_restore_fallback_changes(struct smc_sock *smc)
+{
+ smc->clcsock->file->private_data = smc->sk.sk_socket;
+ smc->clcsock->file = NULL;
+}
+
static int __smc_release(struct smc_sock *smc)
{
struct sock *sk = &smc->sk;
@@ -141,6 +147,7 @@ static int __smc_release(struct smc_sock *smc)
}
sk->sk_state = SMC_CLOSED;
sk->sk_state_change(sk);
+ smc_restore_fallback_changes(smc);
}
sk->sk_prot->unhash(sk);
@@ -1291,8 +1298,8 @@ static void smc_listen_work(struct work_struct *work)
/* check if RDMA is available */
if (!ism_supported) { /* SMC_TYPE_R or SMC_TYPE_B */
/* prepare RDMA check */
- memset(&ini, 0, sizeof(ini));
ini.is_smcd = false;
+ ini.ism_dev = NULL;
ini.ib_lcl = &pclc->lcl;
rc = smc_find_rdma_device(new_smc, &ini);
if (rc) {