Skip to contentSkip to conversation

on failure free the sock from the right place

PATCH New Arnaldo Carvalho de Melo 1 participant 1 message Apr 19, 2005

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 on failure free the sock from the right place

Hi Dave,

Please apply.

Best Regards,

- Arnaldo

------------------------------------------------------------------------

Author: acme
Date: 2005-04-19 01:53:49 -0300 (Tue, 19 Apr 2005) New Revision: 68

Modified:
trunk/net/core/sock.c
Log:
[SOCK] on failure free the sock from the right place

Modified: trunk/net/core/sock.c
===================================================================

net/core/sock.c +4 -1
@@ -642,7 +642,10 @@
 		}
 		
 		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);