]> err.no Git - linux-2.6/blobdiff - mm/slab.c
[CRYPTO] authenc: Move initialisations up to shut up gcc
[linux-2.6] / mm / slab.c
index 671588497e82ae2b4569220fbf145c56c6fd54e6..c31cd3682a0b77ded3ac4e76cded3f427537a551 100644 (file)
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -26,7 +26,7 @@
  * initialized objects.
  *
  * This means, that your constructor is used only for newly allocated
- * slabs and you must pass objects with the same intializations to
+ * slabs and you must pass objects with the same initializations to
  * kmem_cache_free.
  *
  * Each cache can only support one memory type (GFP_DMA, GFP_HIGHMEM,
@@ -1043,7 +1043,7 @@ static struct array_cache **alloc_alien_cache(int node, int limit)
                        }
                        ac_ptr[i] = alloc_arraycache(node, limit, 0xbaadf00d);
                        if (!ac_ptr[i]) {
-                               for (i--; i <= 0; i--)
+                               for (i--; i >= 0; i--)
                                        kfree(ac_ptr[i]);
                                kfree(ac_ptr);
                                return NULL;
@@ -1282,13 +1282,18 @@ static int __cpuinit cpuup_prepare(long cpu)
                        shared = alloc_arraycache(node,
                                cachep->shared * cachep->batchcount,
                                0xbaadf00d);
-                       if (!shared)
+                       if (!shared) {
+                               kfree(nc);
                                goto bad;
+                       }
                }
                if (use_alien_caches) {
                        alien = alloc_alien_cache(node, cachep->limit);
-                       if (!alien)
+                       if (!alien) {
+                               kfree(shared);
+                               kfree(nc);
                                goto bad;
+                       }
                }
                cachep->array[cpu] = nc;
                l3 = cachep->nodelists[node];
@@ -1315,6 +1320,7 @@ static int __cpuinit cpuup_prepare(long cpu)
        }
        return 0;
 bad:
+       cpuup_canceled(cpu);
        return -ENOMEM;
 }
 
@@ -1363,7 +1369,7 @@ static int __cpuinit cpuup_callback(struct notifier_block *nfb,
                 * structure is usually allocated from kmem_cache_create() and
                 * gets destroyed at kmem_cache_destroy().
                 */
-               /* fall thru */
+               /* fall through */
 #endif
        case CPU_UP_CANCELED:
        case CPU_UP_CANCELED_FROZEN:
@@ -3800,7 +3806,7 @@ const char *kmem_cache_name(struct kmem_cache *cachep)
 EXPORT_SYMBOL_GPL(kmem_cache_name);
 
 /*
- * This initializes kmem_list3 or resizes varioius caches for all nodes.
+ * This initializes kmem_list3 or resizes various caches for all nodes.
  */
 static int alloc_kmemlist(struct kmem_cache *cachep)
 {