diff options
author | Zhu Yanjun <yanjun.zhu@linux.dev> | 2024-04-25 20:16:35 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-05-30 10:44:08 +0300 |
commit | e61b07f5b41661ee04bd085d6518a51611357eee (patch) | |
tree | 8f8bf8aab7c7c551baf4ebe9fef1a9a12dba7b1e /drivers/block | |
parent | a8d8cd3d90104e5a822a6c70cc9b8d0ddaff894d (diff) | |
download | linux-e61b07f5b41661ee04bd085d6518a51611357eee.tar.xz |
null_blk: Fix missing mutex_destroy() at module removal
[ 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>
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/null_blk/main.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/block/null_blk/main.c b/drivers/block/null_blk/main.c index ed33cf7192d2..eed63f95e89d 100644 --- a/drivers/block/null_blk/main.c +++ b/drivers/block/null_blk/main.c @@ -2113,6 +2113,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); |