]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 16 Jun 2024 11:32:02 +0000 (13:32 +0200)
[ Upstream commit 07d1b99825f40f9c0d93e6b99d79a08d0717bac1 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/block/null_blk/main.c

index 35b390a785dd4f36d63898351b37958cf792c8a4..ee1c3f476a3a020200840971ba13c4ead98a4133 100644 (file)
@@ -2032,6 +2032,8 @@ static void __exit null_exit(void)
 
        if (g_queue_mode == NULL_Q_MQ && shared_tags)
                blk_mq_free_tag_set(&tag_set);
+
+       mutex_destroy(&lock);
 }
 
 module_init(null_init);