[<prev] [next>] [day] [month] [year] [list]
Message-ID: <1516188266-143804-1-git-send-email-weiyongjun1@huawei.com>
Date: Wed, 17 Jan 2018 11:24:26 +0000
From: Wei Yongjun <weiyongjun1@...wei.com>
To: Alasdair Kergon <agk@...hat.com>, Mike Snitzer <snitzer@...hat.com>
CC: Wei Yongjun <weiyongjun1@...wei.com>, <dm-devel@...hat.com>,
<linux-kernel@...r.kernel.org>
Subject: [PATCH -next] dm crypt: fix error return code in crypt_ctr()
Fix to return error code -ENOMEM from the mempool_create_kmalloc_pool()
error handling case instead of 0, as done elsewhere in this function.
Signed-off-by: Wei Yongjun <weiyongjun1@...wei.com>
---
drivers/md/dm-crypt.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
index 9fc12f5..45f3acf 100644
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -2740,6 +2740,7 @@ static int crypt_ctr(struct dm_target *ti, unsigned int argc, char **argv)
cc->tag_pool_max_sectors * cc->on_disk_tag_size);
if (!cc->tag_pool) {
ti->error = "Cannot allocate integrity tags mempool";
+ ret = -ENOMEM;
goto bad;
}
Powered by blists - more mailing lists