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-next>] [day] [month] [year] [list]
Date:	Tue, 07 Jan 2014 23:19:56 +0000 (GMT)
From:	Eunbong Song <eunb.song@...sung.com>
To:	computersforpeace@...il.com, dwmw2@...radead.org
Cc:	linux-mtd@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: [PATCH] mtd: nand: make more readable panic_nand_wait_ready() and
 nand_wait_ready()


panic_nand_wait_ready() and nand_wait_ready() calls dev_ready() without checking if it exists.
This patch add check routine dev_ready() before run dev_ready()
and this makes the code more readable

Signed-off-by: Eunbong Song <eunb.song@...sung.com>
---
 drivers/mtd/nand/nand_base.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index bd39f7b..110db78 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -473,8 +473,10 @@ static void panic_nand_wait_ready(struct mtd_info *mtd, unsigned long timeo)
 
 	/* Wait for the device to get ready */
 	for (i = 0; i < timeo; i++) {
-		if (chip->dev_ready(mtd))
-			break;
+		if(chip->dev_ready){
+			if (chip->dev_ready(mtd))
+				break;
+		}
 		touch_softlockup_watchdog();
 		mdelay(1);
 	}
@@ -493,8 +495,10 @@ void nand_wait_ready(struct mtd_info *mtd)
 	led_trigger_event(nand_led_trigger, LED_FULL);
 	/* Wait until command is processed or timeout occurs */
 	do {
-		if (chip->dev_ready(mtd))
-			break;
+		if(chip->dev_ready){
+			if (chip->dev_ready(mtd))
+				break;
+		}
 		touch_softlockup_watchdog();
 	} while (time_before(jiffies, timeo));
 	led_trigger_event(nand_led_trigger, LED_OFF);
-- 
1.7.0.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ