diff options
Diffstat (limited to 'net/bluetooth/l2cap_sock.c')
-rw-r--r-- | net/bluetooth/l2cap_sock.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c index a4bb27e8427e..1497edd191a2 100644 --- a/net/bluetooth/l2cap_sock.c +++ b/net/bluetooth/l2cap_sock.c | |||
@@ -245,6 +245,7 @@ static int l2cap_sock_getname(struct socket *sock, struct sockaddr *addr, int *l | |||
245 | 245 | ||
246 | BT_DBG("sock %p, sk %p", sock, sk); | 246 | BT_DBG("sock %p, sk %p", sock, sk); |
247 | 247 | ||
248 | memset(la, 0, sizeof(struct sockaddr_l2)); | ||
248 | addr->sa_family = AF_BLUETOOTH; | 249 | addr->sa_family = AF_BLUETOOTH; |
249 | *len = sizeof(struct sockaddr_l2); | 250 | *len = sizeof(struct sockaddr_l2); |
250 | 251 | ||
@@ -1174,7 +1175,7 @@ static struct sock *l2cap_sock_alloc(struct net *net, struct socket *sock, int p | |||
1174 | 1175 | ||
1175 | chan = l2cap_chan_create(); | 1176 | chan = l2cap_chan_create(); |
1176 | if (!chan) { | 1177 | if (!chan) { |
1177 | l2cap_sock_kill(sk); | 1178 | sk_free(sk); |
1178 | return NULL; | 1179 | return NULL; |
1179 | } | 1180 | } |
1180 | 1181 | ||