Unverified Commit aeeb8bf5 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!10589 v2 ax25: Fix refcount imbalance on inbound connections

parents 4f1da763 ebfe8cc1
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1369,8 +1369,10 @@ static int ax25_accept(struct socket *sock, struct socket *newsock, int flags,
{
	struct sk_buff *skb;
	struct sock *newsk;
	ax25_dev *ax25_dev;
	DEFINE_WAIT(wait);
	struct sock *sk;
	ax25_cb *ax25;
	int err = 0;

	if (sock->state != SS_UNCONNECTED)
@@ -1425,6 +1427,10 @@ static int ax25_accept(struct socket *sock, struct socket *newsock, int flags,
	kfree_skb(skb);
	sk_acceptq_removed(sk);
	newsock->state = SS_CONNECTED;
	ax25 = sk_to_ax25(newsk);
	ax25_dev = ax25->ax25_dev;
	dev_hold(ax25_dev->dev);
	ax25_dev_hold(ax25_dev);

out:
	release_sock(sk);