diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
index ba952a032598c2411bb3f7ff793f6d00baec92bc..bdc52d6922b7d998f27068cce53ededb302f0b09 100644
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -920,6 +920,8 @@ static void crypt_dtr(struct dm_target *ti)
 {
 	struct crypt_config *cc = (struct crypt_config *) ti->private;
 
+	flush_workqueue(_kcryptd_workqueue);
+
 	bioset_free(cc->bs);
 	mempool_destroy(cc->page_pool);
 	mempool_destroy(cc->io_pool);