lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1379937840-9041-1-git-send-email-chaiw.fnst@cn.fujitsu.com>
Date:	Mon, 23 Sep 2013 20:04:00 +0800
From:	chaiwen <chaiw.fnst@...fujitsu.com>
To:	npiggin@...nel.dk
Cc:	linux-kernel@...r.kernel.org, chaiwen <chaiw.fnst@...fujitsu.com>
Subject: [PATCH] brd: return register_blkdev err code when it fails


Hi Nick

when register_blk fails,no matter what reasons,brd_init always
returns a "-EIO" error code. if brd_init returns the error code
returned by register_blkdev,the formatted error info reported
when module inserting failed(caused by register_blkdev failing)
could be more meaningfull.

Signed-off-by: chaiwen <chaiw.fnst@...fujitsu.com>
---
 drivers/block/brd.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/block/brd.c b/drivers/block/brd.c
index 9bf4371..361204d 100644
--- a/drivers/block/brd.c
+++ b/drivers/block/brd.c
@@ -557,6 +557,7 @@ static int __init brd_init(void)
 	int i, nr;
 	unsigned long range;
 	struct brd_device *brd, *next;
+	int ret;
 
 	/*
 	 * brd module now has a feature to instantiate underlying device
@@ -602,8 +603,8 @@ static int __init brd_init(void)
 		range = 1UL << MINORBITS;
 	}
 
-	if (register_blkdev(RAMDISK_MAJOR, "ramdisk"))
-		return -EIO;
+	if (ret = register_blkdev(RAMDISK_MAJOR, "ramdisk"))
+		return ret;
 
 	for (i = 0; i < nr; i++) {
 		brd = brd_alloc(i);
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ