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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 06 Nov 2015 17:52:15 +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, linux-raid@...r.kernel.org,
	linux-mmc@...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 8/8] ide/ide-probe.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.

Verfied on X86 based ubuntu machine.
This patch depends on [PATCH 1/8] block/genhd.c: Add error handling

Signed-off-by: Vishnu Pratap Singh <vishnu.ps@...sung.com>
---
 drivers/ide/ide-probe.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index 0b63fac..651eb05 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -917,9 +917,9 @@ static int exact_lock(dev_t dev, void *data)
 	return 0;
 }
 
-void ide_register_region(struct gendisk *disk)
+int ide_register_region(struct gendisk *disk)
 {
-	blk_register_region(MKDEV(disk->major, disk->first_minor),
+	return blk_register_region(MKDEV(disk->major, disk->first_minor),
 			    disk->minors, NULL, exact_match, exact_lock, disk);
 }
 
@@ -988,8 +988,9 @@ static int hwif_init(ide_hwif_t *hwif)
 		goto out;
 	}
 
-	blk_register_region(MKDEV(hwif->major, 0), MAX_DRIVES << PARTN_BITS,
-			    THIS_MODULE, ata_probe, ata_lock, hwif);
+	if (blk_register_region(MKDEV(hwif->major, 0), MAX_DRIVES << PARTN_BITS,
+			    THIS_MODULE, ata_probe, ata_lock, hwif))
+		goto out;
 	return 1;
 
 out:
-- 
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