The fix looks good, but could be simplified a bit more: diff --git a/block/blk-mq.c b/block/blk-mq.c index ee16b4c34c6a5..cdd8efcec1916 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -4381,7 +4381,7 @@ static int blk_mq_realloc_tag_set_tags(struct blk_mq_tag_set *set, struct blk_mq_tags **new_tags; if (set->nr_hw_queues >= new_nr_hw_queues) - return 0; + goto done; new_tags = kcalloc_node(new_nr_hw_queues, sizeof(struct blk_mq_tags *), GFP_KERNEL, set->numa_node); @@ -4393,8 +4393,8 @@ static int blk_mq_realloc_tag_set_tags(struct blk_mq_tag_set *set, sizeof(*set->tags)); kfree(set->tags); set->tags = new_tags; +done: set->nr_hw_queues = new_nr_hw_queues; - return 0; }