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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 10 Nov 2015 08:55:50 +0530
From:	Vishnu Pratap Singh <vishnu.ps@...sung.com>
To:	axboe@...nel.dk, akpm@...ux-foundation.org,
	linux-kernel@...r.kernel.org, jmoyer@...hat.com,
	minchan@...nel.org, ngupta@...are.org,
	sergey.senozhatsky.work@...il.com, davem@...emloft.net,
	neilb@...e.com, ulf.hansson@...aro.org, tiwai@...e.de,
	hare@...e.de, ming.lei@...onical.com, jarod@...hat.com,
	viro@...iv.linux.org.uk, tj@...nel.org, adrian.hunter@...el.com,
	jonathanh@...dia.com, grundler@...omium.org,
	linux-ide@...r.kernel.org
Cc:	cpgs@...sung.com, vishu13285@...il.com, pintu.k@...sung.com,
	rohit.kr@...sung.com, Vishnu Pratap Singh <vishnu.ps@...sung.com>
Subject: [PATCH v2] block/floppy.c: handle blk_register_region() return value

This patch handles blk_register_region() return value.
Earlier blk_register_region() function doesn't handle error
cases, now it is added, so the callers of this function
should also handle it.

Signed-off-by: Vishnu Pratap Singh <vishnu.ps@...sung.com>
---
 - Verfied on X86 based ubuntu machine.
 - This patch depends on [PATCH 1/8] block/genhd.c: Add error handling
 - Changes v1 -> v2:
	- updated as per the Grant's review comment

 drivers/block/floppy.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
index 331363e..459807c 100644
--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -4219,8 +4219,10 @@ static int __init do_floppy_init(void)
 	if (err)
 		goto out_unreg_blkdev;
 
-	blk_register_region(MKDEV(FLOPPY_MAJOR, 0), 256, THIS_MODULE,
+	err = blk_register_region(MKDEV(FLOPPY_MAJOR, 0), 256, THIS_MODULE,
 			    floppy_find, NULL, NULL);
+	if (err)
+		goto out_driver_unregister;
 
 	for (i = 0; i < 256; i++)
 		if (ITYPE(i))
@@ -4359,6 +4361,7 @@ out_release_dma:
 		floppy_release_irq_and_dma();
 out_unreg_region:
 	blk_unregister_region(MKDEV(FLOPPY_MAJOR, 0), 256);
+out_driver_unregister:
 	platform_driver_unregister(&floppy_driver);
 out_unreg_blkdev:
 	unregister_blkdev(FLOPPY_MAJOR, "fd");
-- 
1.9.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