block/blk_mq: Only call kfree when set->tags isn't null
PATCH 1/1 block/blk_mq: Only call kfree when set->tags isn't null
In function blk_mq_realloc_tag_set_tags, there is a check on set->tags, but kfree should only be called when set->tags isn't null
Signed-off-by Liu Wei <[email protected]>
--- block/blk-mq.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
block/blk-mq.c +3 -2
@@ -4409,10 +4409,11 @@ static int blk_mq_realloc_tag_set_tags(struct blk_mq_tag_set *set,if (!new_tags)return -ENOMEM ; -if (set->tags) +if (set->tags) {memcpy (new_tags, set->tags, set->nr_hw_queues *sizeof (*set->tags)); -kfree (set->tags); +kfree (set->tags); + } set->tags = new_tags;for (i = set->nr_hw_queues; i < new_nr_hw_queues; i++) {
Signature · 1 line
2.42.1