[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210613113035.2329421-4-chengzhihao1@huawei.com>
Date: Sun, 13 Jun 2021 19:30:32 +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 3/6] Revert "mtd: mtd_blkdevs: don't increase 'open' count on error path"
This reverts commit 342ff28f5a2e5aa3236617bd2bddf6c749677ef2.
---
drivers/mtd/mtd_blkdevs.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c
index 00b13f71ccf3..100a3c96760c 100644
--- a/drivers/mtd/mtd_blkdevs.c
+++ b/drivers/mtd/mtd_blkdevs.c
@@ -211,7 +211,7 @@ static int blktrans_open(struct block_device *bdev, fmode_t mode)
mutex_lock(&dev->lock);
- if (dev->open)
+ if (dev->open++)
goto unlock;
kref_get(&dev->ref);
@@ -232,7 +232,6 @@ static int blktrans_open(struct block_device *bdev, fmode_t mode)
dev->file_mode = mode;
unlock:
- dev->open++;
mutex_unlock(&dev->lock);
blktrans_dev_put(dev);
return ret;
--
2.31.1
Powered by blists - more mailing lists