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

!15397 Bluetooth: L2CAP: handle NULL sock pointer in l2cap_sock_alloc

parents 8bca4449 897a9a03
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -1864,6 +1864,7 @@ static struct sock *l2cap_sock_alloc(struct net *net, struct socket *sock,
	chan = l2cap_chan_create();
	chan = l2cap_chan_create();
	if (!chan) {
	if (!chan) {
		sk_free(sk);
		sk_free(sk);
		if (sock)
			sock->sk = NULL;
			sock->sk = NULL;
		return NULL;
		return NULL;
	}
	}