diff --git a/drivers/md/dm-rq.c b/drivers/md/dm-rq.c index 2bd2444ad99c..6bc61927d320 100644 --- a/drivers/md/dm-rq.c +++ b/drivers/md/dm-rq.c @@ -572,6 +572,7 @@ int dm_mq_init_request_queue(struct mapped_device *md, struct dm_table *t) blk_mq_free_tag_set(md->tag_set); out_kfree_tag_set: kfree(md->tag_set); + md->tag_set = NULL; return err; } @@ -581,6 +582,7 @@ void dm_mq_cleanup_mapped_device(struct mapped_device *md) if (md->tag_set) { blk_mq_free_tag_set(md->tag_set); kfree(md->tag_set); + md->tag_set = NULL; } }