mtd: spi-nor: hide jedec_id sysfs attribute if not present
[platform/kernel/linux-starfive.git] / block / blk-mq.c
index 8070b6c..33292c0 100644 (file)
@@ -3112,8 +3112,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) {