diff options
author | Wei Yongjun <weiyongjun1@huawei.com> | 2018-01-17 12:24:26 +0100 |
---|---|---|
committer | Mike Snitzer <snitzer@redhat.com> | 2018-01-17 15:10:55 +0100 |
commit | 3cc2e57c4beabcbbaa46e1ac6d77ca8276a4a42d (patch) | |
tree | 7db3f8e05972588e2a9c71821f05c5aa4005bf1d /drivers/md/dm-crypt.c | |
parent | dm crypt: wipe kernel key copy after IV initialization (diff) | |
download | linux-3cc2e57c4beabcbbaa46e1ac6d77ca8276a4a42d.tar.xz linux-3cc2e57c4beabcbbaa46e1ac6d77ca8276a4a42d.zip |
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.
Fixes: ef43aa38063a6 ("dm crypt: add cryptographic data integrity protection (authenticated encryption)")
Cc: stable@vger.kernel.org # 4.12+
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/md/dm-crypt.c')
-rw-r--r-- | drivers/md/dm-crypt.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c index 971241409c30..554d60394c06 100644 --- a/drivers/md/dm-crypt.c +++ b/drivers/md/dm-crypt.c @@ -2746,6 +2746,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; } |