drm/etnaviv: potential NULL dereference
[linux-2.6-microblaze.git] / init / initramfs.c
index f6f4a1e..7cea802 100644 (file)
@@ -550,7 +550,6 @@ skip:
        initrd_end = 0;
 }
 
-#ifdef CONFIG_BLK_DEV_RAM
 #define BUF_SIZE 1024
 static void __init clean_rootfs(void)
 {
@@ -597,7 +596,6 @@ static void __init clean_rootfs(void)
        ksys_close(fd);
        kfree(buf);
 }
-#endif
 
 static int __init populate_rootfs(void)
 {
@@ -640,18 +638,14 @@ static int __init populate_rootfs(void)
                printk(KERN_INFO "Unpacking initramfs...\n");
                err = unpack_to_rootfs((char *)initrd_start,
                        initrd_end - initrd_start);
-               if (err)
+               if (err) {
                        printk(KERN_EMERG "Initramfs unpacking failed: %s\n", err);
+                       clean_rootfs();
+               }
                free_initrd();
 #endif
        }
        flush_delayed_fput();
-       /*
-        * Try loading default modules from initramfs.  This gives
-        * us a chance to load before device_initcalls.
-        */
-       load_default_modules();
-
        return 0;
 }
 rootfs_initcall(populate_rootfs);