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 6e1ee6987c78dbca4cb3f01aaa031e4b3a42708f..fe9acb0ae4808bd663187d802960d788f73276c1 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;