ASoC: core: Adapt for debugfs API change
[sfrench/cifs-2.6.git] / init / main.c
index c86a1c8f19f40be9508b7b979959bc57a47e70ce..598e278b46f743d777e6f9375ac1c932896ef99c 100644 (file)
@@ -373,12 +373,20 @@ static inline void smp_prepare_cpus(unsigned int maxcpus) { }
  */
 static void __init setup_command_line(char *command_line)
 {
-       saved_command_line =
-               memblock_alloc(strlen(boot_command_line) + 1, SMP_CACHE_BYTES);
-       initcall_command_line =
-               memblock_alloc(strlen(boot_command_line) + 1, SMP_CACHE_BYTES);
-       static_command_line = memblock_alloc(strlen(command_line) + 1,
-                                            SMP_CACHE_BYTES);
+       size_t len = strlen(boot_command_line) + 1;
+
+       saved_command_line = memblock_alloc(len, SMP_CACHE_BYTES);
+       if (!saved_command_line)
+               panic("%s: Failed to allocate %zu bytes\n", __func__, len);
+
+       initcall_command_line = memblock_alloc(len, SMP_CACHE_BYTES);
+       if (!initcall_command_line)
+               panic("%s: Failed to allocate %zu bytes\n", __func__, len);
+
+       static_command_line = memblock_alloc(len, SMP_CACHE_BYTES);
+       if (!static_command_line)
+               panic("%s: Failed to allocate %zu bytes\n", __func__, len);
+
        strcpy(saved_command_line, boot_command_line);
        strcpy(static_command_line, command_line);
 }
@@ -770,8 +778,14 @@ static int __init initcall_blacklist(char *str)
                        pr_debug("blacklisting initcall %s\n", str_entry);
                        entry = memblock_alloc(sizeof(*entry),
                                               SMP_CACHE_BYTES);
+                       if (!entry)
+                               panic("%s: Failed to allocate %zu bytes\n",
+                                     __func__, sizeof(*entry));
                        entry->buf = memblock_alloc(strlen(str_entry) + 1,
                                                    SMP_CACHE_BYTES);
+                       if (!entry->buf)
+                               panic("%s: Failed to allocate %zu bytes\n",
+                                     __func__, strlen(str_entry) + 1);
                        strcpy(entry->buf, str_entry);
                        list_add(&entry->next, &blacklisted_initcalls);
                }