--- a/mm/swapfile.c~mm-swapfile-remove-needless-request_queue-null-pointer-check +++ a/mm/swapfile.c @@ -3118,7 +3118,7 @@ static bool swap_discardable(struct swap { struct request_queue *q = bdev_get_queue(si->bdev); - if (!q || !blk_queue_discard(q)) + if (!blk_queue_discard(q)) return false; return true;