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]
Message-ID: <7b381eef-c54f-d2c9-7281-a90d519c22f1@users.sourceforge.net>
Date:   Sat, 6 Jan 2018 16:10:40 +0100
From:   SF Markus Elfring <elfring@...rs.sourceforge.net>
To:     linux-mtd@...ts.infradead.org,
        Boris Brezillon <boris.brezillon@...e-electrons.com>,
        Brian Norris <computersforpeace@...il.com>,
        Cyrille Pitchen <cyrille.pitchen@...ev4u.fr>,
        David Woodhouse <dwmw2@...radead.org>,
        Marek Vasut <marek.vasut@...il.com>,
        Richard Weinberger <richard@....at>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        kernel-janitors@...r.kernel.org
Subject: [PATCH 4/5] mtd/rfd_ftl: Return directly after a failed kmalloc() in
 erase_block()

From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Sat, 6 Jan 2018 15:18:28 +0100

* Return directly after a call of the function "kmalloc" failed
  at the beginning.

* Delete an initialisation for the variable "rc" and the jump label "err"
  which became unnecessary with this refactoring.

Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
 drivers/mtd/rfd_ftl.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/mtd/rfd_ftl.c b/drivers/mtd/rfd_ftl.c
index dcf1b88e1193..e3155ec4be64 100644
--- a/drivers/mtd/rfd_ftl.c
+++ b/drivers/mtd/rfd_ftl.c
@@ -323,11 +323,11 @@ static void erase_callback(struct erase_info *erase)
 
 static int erase_block(struct partition *part, int block)
 {
-	int rc = -ENOMEM;
+	int rc;
 	struct erase_info *erase = kmalloc(sizeof(*erase), GFP_KERNEL);
 
 	if (!erase)
-		goto err;
+		return -ENOMEM;
 
 	erase->mtd = part->mbd.mtd;
 	erase->callback = erase_callback;
@@ -346,8 +346,6 @@ static int erase_block(struct partition *part, int block)
 				(unsigned long long)erase->len, part->mbd.mtd->name);
 		kfree(erase);
 	}
-
-err:
 	return rc;
 }
 
-- 
2.15.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ