Skip to contentSkip to conversation

init: return proper error code in do_mounts_rd

PATCH New Davidlohr Bueso 1 participant 1 message Jan 20, 2011 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 init: return proper error code in do_mounts_rd

From: Davidlohr Bueso <[email protected]>

In do_mounts_rd() if memory cannot be allocated, return -ENOMEM.

---
 init/do_mounts_rd.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
init/do_mounts_rd.c +1 -1
index 6e1ee69..fe9acb0 100644
@@ -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;
Signature · 1 line
1.7.1