diff --git a/block/blk-mq.c b/block/blk-mq.c index 7fbbad7b08b30f987a4938a8e0df4c89ecbdfbea..b9b2d9412b02167aa57e75194ed4e973558e01df 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -2450,8 +2450,11 @@ static void blk_mq_clear_rq_mapping(struct blk_mq_tags *drv_tags, struct page *page; unsigned long flags; - /* There is no need to clear a driver tags own mapping */ - if (drv_tags == tags) + /* + * There is no need to clear mapping if driver tags is not initialized + * or the mapping belongs to the driver tags. + */ + if (!drv_tags || drv_tags == tags) return; list_for_each_entry(page, &tags->page_list, lru) {