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: <56858F8E.7050307@users.sourceforge.net>
Date:	Thu, 31 Dec 2015 21:26:54 +0100
From:	SF Markus Elfring <elfring@...rs.sourceforge.net>
To:	linux-mtd@...ts.infradead.org,
	Brian Norris <computersforpeace@...il.com>,
	David Woodhouse <dwmw2@...radead.org>
Cc:	LKML <linux-kernel@...r.kernel.org>,
	kernel-janitors@...r.kernel.org,
	Julia Lawall <julia.lawall@...6.fr>
Subject: [PATCH 2/3] mtd-rfd_ftl: Refactoring for move_block_contents()

From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Thu, 31 Dec 2015 20:54:50 +0100

This issue was detected by using the Coccinelle software.

Rename jump labels according to the current Linux coding style convention.

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

diff --git a/drivers/mtd/rfd_ftl.c b/drivers/mtd/rfd_ftl.c
index 2927e1b..9b59423 100644
--- a/drivers/mtd/rfd_ftl.c
+++ b/drivers/mtd/rfd_ftl.c
@@ -366,13 +366,13 @@ static int move_block_contents(struct partition *part, int block_no, u_long *old
 	sector_data = kmalloc(SECTOR_SIZE, GFP_KERNEL);
 	if (!sector_data) {
 		rc = -ENOMEM;
-		goto err3;
+		goto reset_reclaim;
 	}
 
 	map = kmalloc(part->header_size, GFP_KERNEL);
 	if (!map) {
 		rc = -ENOMEM;
-		goto err2;
+		goto free_sector;
 	}
 
 	rc = mtd_read(part->mbd.mtd, part->blocks[block_no].offset,
@@ -385,8 +385,7 @@ static int move_block_contents(struct partition *part, int block_no, u_long *old
 		printk(KERN_ERR PREFIX "error reading '%s' at "
 			"0x%lx\n", part->mbd.mtd->name,
 			part->blocks[block_no].offset);
-
-		goto err;
+		goto free_map;
 	}
 
 	for (i=0; i<part->data_sectors_per_block; i++) {
@@ -417,7 +416,6 @@ static int move_block_contents(struct partition *part, int block_no, u_long *old
 		}
 		rc = mtd_read(part->mbd.mtd, addr, SECTOR_SIZE, &retlen,
 			      sector_data);
-
 		if (!rc && retlen != SECTOR_SIZE)
 			rc = -EIO;
 
@@ -425,24 +423,20 @@ static int move_block_contents(struct partition *part, int block_no, u_long *old
 			printk(KERN_ERR PREFIX "'%s': Unable to "
 				"read sector for relocation\n",
 				part->mbd.mtd->name);
-
-			goto err;
+			goto free_map;
 		}
 
 		rc = rfd_ftl_writesect((struct mtd_blktrans_dev*)part,
 				entry, sector_data);
-
 		if (rc)
-			goto err;
+			goto free_map;
 	}
-
-err:
+free_map:
 	kfree(map);
-err2:
+free_sector:
 	kfree(sector_data);
-err3:
+reset_reclaim:
 	part->is_reclaiming = 0;
-
 	return rc;
 }
 
-- 
2.6.3

--
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