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: <20210613113035.2329421-5-chengzhihao1@huawei.com>
Date:   Sun, 13 Jun 2021 19:30:33 +0800
From:   Zhihao Cheng <chengzhihao1@...wei.com>
To:     <miquel.raynal@...tlin.com>, <richard@....at>, <vigneshr@...com>
CC:     <linux-mtd@...ts.infradead.org>, <linux-kernel@...r.kernel.org>,
        <chengzhihao1@...wei.com>, <yukuai3@...wei.com>
Subject: [PATCH 4/6] Revert "mtd: mtd_blkdevs: fix error path in blktrans_open"

This reverts commit 94735ec4044a6d318b83ad3c5794e931ed168d10.
---
 drivers/mtd/mtd_blkdevs.c | 23 +++--------------------
 1 file changed, 3 insertions(+), 20 deletions(-)

diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c
index 100a3c96760c..41dd3b955136 100644
--- a/drivers/mtd/mtd_blkdevs.c
+++ b/drivers/mtd/mtd_blkdevs.c
@@ -217,34 +217,17 @@ static int blktrans_open(struct block_device *bdev, fmode_t mode)
 	kref_get(&dev->ref);
 	__module_get(dev->tr->owner);
 
-	if (!dev->mtd)
-		goto unlock;
-
-	if (dev->tr->open) {
-		ret = dev->tr->open(dev);
-		if (ret)
-			goto error_put;
+	if (dev->mtd) {
+		ret = dev->tr->open ? dev->tr->open(dev) : 0;
+		__get_mtd_device(dev->mtd);
 	}
 
-	ret = __get_mtd_device(dev->mtd);
-	if (ret)
-		goto error_release;
 	dev->file_mode = mode;
 
 unlock:
 	mutex_unlock(&dev->lock);
 	blktrans_dev_put(dev);
 	return ret;
-
-error_release:
-	if (dev->tr->release)
-		dev->tr->release(dev);
-error_put:
-	module_put(dev->tr->owner);
-	kref_put(&dev->ref, blktrans_dev_release);
-	mutex_unlock(&dev->lock);
-	blktrans_dev_put(dev);
-	return ret;
 }
 
 static void blktrans_release(struct gendisk *disk, fmode_t mode)
-- 
2.31.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ