mmc: core: Fix tag set memory leak
authorRaul E Rangel <rrangel@chromium.org>
Thu, 2 May 2019 19:07:14 +0000 (13:07 -0600)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 6 May 2019 10:33:03 +0000 (12:33 +0200)
The tag set is allocated in mmc_init_queue but never freed. This results
in a memory leak. This change makes sure we free the tag set when the
queue is also freed.

Signed-off-by: Raul E Rangel <rrangel@chromium.org>
Reviewed-by: Jens Axboe <axboe@kernel.dk>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Fixes: 81196976ed94 ("mmc: block: Add blk-mq support")
Cc: stable@vger.kernel.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/core/queue.c

index 7c364a9c4eeb4bb6f3fa7f45913279078262a30e..b5b9c6142f0819cdcdbdca39136ae4725d1d3d02 100644 (file)
@@ -472,6 +472,7 @@ void mmc_cleanup_queue(struct mmc_queue *mq)
                blk_mq_unquiesce_queue(q);
 
        blk_cleanup_queue(q);
+       blk_mq_free_tag_set(&mq->tag_set);
 
        /*
         * A request can be completed before the next request, potentially