netdev
[Top] [All Lists]

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

To: davem@xxxxxxxxxxxxx
Subject: [PATCH][SOCK] on failure free the sock from the right place
From: acme@xxxxxxxxxxxxxxxxxx (Arnaldo Carvalho de Melo)
Date: Tue, 19 Apr 2005 01:59:14 -0300
Cc: netdev@xxxxxxxxxxx, Andrew Morton <akpm@xxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: Mutt/1.5.6i
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

Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxxxxxxxxxx>
Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>


Modified: trunk/net/core/sock.c
===================================================================
--- trunk/net/core/sock.c       2005-04-19 02:32:15 UTC (rev 67)
+++ trunk/net/core/sock.c       2005-04-19 04:53:49 UTC (rev 68)
@@ -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);



<Prev in Thread] Current Thread [Next in Thread>
  • [PATCH][SOCK] on failure free the sock from the right place, Arnaldo Carvalho de Melo <=