diff --git a/net/9p/trans_fd.c b/net/9p/trans_fd.c index 8f528e783a6c533f604371228b7e31c28ea87577..33ea665982c26dd999e9ecba7d42919cb3a31a40 100644 --- a/net/9p/trans_fd.c +++ b/net/9p/trans_fd.c @@ -846,8 +846,10 @@ static int p9_socket_open(struct p9_client *client, struct socket *csocket) struct file *file; p = kzalloc(sizeof(struct p9_trans_fd), GFP_KERNEL); - if (!p) + if (!p) { + sock_release(csocket); return -ENOMEM; + } csocket->sk->sk_allocation = GFP_NOIO; file = sock_alloc_file(csocket, 0, NULL);