Commit 88a66858 authored by Arnaldo Carvalho de Melo's avatar Arnaldo Carvalho de Melo Committed by David S. Miller
Browse files

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

parent 9c2b3328
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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)) {
			if (slab != NULL)
				kmem_cache_free(slab, sk);
			else
				kfree(sk);
			sk = NULL;
		} else
			__module_get(prot->owner);