null_blk: Fix missing mutex_destroy() at module removal
authorZhu Yanjun <yanjun.zhu@linux.dev>
Thu, 25 Apr 2024 17:16:35 +0000 (19:16 +0200)
committerJens Axboe <axboe@kernel.dk>
Thu, 25 Apr 2024 20:15:00 +0000 (14:15 -0600)
When a mutex lock is not used any more, the function mutex_destroy
should be called to mark the mutex lock uninitialized.

Fixes: f2298c0403b0 ("null_blk: multi queue aware block test driver")
Signed-off-by: Zhu Yanjun <yanjun.zhu@linux.dev>
Link: https://lore.kernel.org/r/20240425171635.4227-1-yanjun.zhu@linux.dev
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/null_blk/main.c

index bccee438b4b7e4b02c3e290b4a8de381ccc8c5b5..8c0e5e3fd1edbc0adffc433e068b67caf1ead508 100644 (file)
@@ -2127,6 +2127,8 @@ static void __exit null_exit(void)
 
        if (tag_set.ops)
                blk_mq_free_tag_set(&tag_set);
+
+       mutex_destroy(&lock);
 }
 
 module_init(null_init);