Skip to content

Commit f054314

Browse files
Wei Yongjungregkh
authored andcommitted
dm crypt: fix error return code in crypt_ctr()
commit 3cc2e57 upstream. 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: ef43aa3 ("dm crypt: add cryptographic data integrity protection (authenticated encryption)") Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 82e12f1 commit f054314

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

drivers/md/dm-crypt.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2746,6 +2746,7 @@ static int crypt_ctr(struct dm_target *ti, unsigned int argc, char **argv)
27462746
cc->tag_pool_max_sectors * cc->on_disk_tag_size);
27472747
if (!cc->tag_pool) {
27482748
ti->error = "Cannot allocate integrity tags mempool";
2749+
ret = -ENOMEM;
27492750
goto bad;
27502751
}
27512752

0 commit comments

Comments
 (0)