md: alloc_disk_sb(): Return proper error value.
authorAndre Noll <maan@systemlinux.org>
Fri, 11 Jul 2008 12:02:20 +0000 (22:02 +1000)
committerNeil Brown <neilb@suse.de>
Fri, 11 Jul 2008 12:02:20 +0000 (22:02 +1000)
If alloc_page() fails, ENOMEM is a more suitable error value
than EINVAL.

Signed-off-by: Andre Noll <maan@systemlinux.org>
Signed-off-by: Neil Brown <neilb@suse.de>
drivers/md/md.c

index 20e03db8fdfcac048de4c8460b992d407cc6f0f3..9756ea0a19b93bae46a6bd943443af26c80349e5 100644 (file)
@@ -372,7 +372,7 @@ static int alloc_disk_sb(mdk_rdev_t * rdev)
        rdev->sb_page = alloc_page(GFP_KERNEL);
        if (!rdev->sb_page) {
                printk(KERN_ALERT "md: out of memory.\n");
-               return -EINVAL;
+               return -ENOMEM;
        }
 
        return 0;