提交 88a66858 编写于 作者: A Arnaldo Carvalho de Melo 提交者: David S. Miller

[SOCK]: on failure free the sock from the right place

Signed-off-by: NArnaldo Carvalho de Melo <acme@ghostprotocols.net>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 9c2b3328
......@@ -641,7 +641,10 @@ struct sock *sk_alloc(int family, int priority, struct proto *prot, int zero_it)
}
if (security_sk_alloc(sk, family, priority)) {
kmem_cache_free(slab, sk);
if (slab != NULL)
kmem_cache_free(slab, sk);
else
kfree(sk);
sk = NULL;
} else
__module_get(prot->owner);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册