init: return proper error code in do_mounts_rd()
authorDavidlohr Bueso <dave@gnu.org>
Tue, 22 Mar 2011 23:34:49 +0000 (16:34 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 23 Mar 2011 00:44:15 +0000 (17:44 -0700)
In do_mounts_rd() if memory cannot be allocated, return -ENOMEM.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
init/do_mounts_rd.c

index 6e1ee69..fe9acb0 100644 (file)
@@ -64,7 +64,7 @@ identify_ramdisk_image(int fd, int start_block, decompress_fn *decompressor)
 
        buf = kmalloc(size, GFP_KERNEL);
        if (!buf)
-               return -1;
+               return -ENOMEM;
 
        minixsb = (struct minix_super_block *) buf;
        ext2sb = (struct ext2_super_block *) buf;