diff options
author | Mark Brown <broonie@kernel.org> | 2020-12-11 17:49:01 +0000 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2020-12-11 17:49:01 +0000 |
commit | 3e98a021cc85e7d52acdd1eae8a988e975ec5bf9 (patch) | |
tree | cecfac58b9550a602555a02a9d583ed0f3378b38 /net/x25 | |
parent | 58f7553fa424fd0fd74e8b796d50c66014cebebe (diff) | |
parent | 2fee9583198eb97b5351feda7bd825e0f778385c (diff) |
Merge remote-tracking branch 'spi/for-5.11' into spi-next
Diffstat (limited to 'net/x25')
-rw-r--r-- | net/x25/af_x25.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c index 0bbb283f23c9..a10487e7574c 100644 --- a/net/x25/af_x25.c +++ b/net/x25/af_x25.c @@ -825,7 +825,7 @@ static int x25_connect(struct socket *sock, struct sockaddr *uaddr, sock->state = SS_CONNECTED; rc = 0; out_put_neigh: - if (rc) { + if (rc && x25->neighbour) { read_lock_bh(&x25_list_lock); x25_neigh_put(x25->neighbour); x25->neighbour = NULL; @@ -1050,6 +1050,7 @@ int x25_rx_call_request(struct sk_buff *skb, struct x25_neigh *nb, makex25->lci = lci; makex25->dest_addr = dest_addr; makex25->source_addr = source_addr; + x25_neigh_hold(nb); makex25->neighbour = nb; makex25->facilities = facilities; makex25->dte_facilities= dte_facilities; |