diff mbox series

[v2,1/1] null_blk: Fix the problem "mutex_destroy missing"

Message ID 20240425170127.4926-1-yanjun.zhu@linux.dev (mailing list archive)
State New, archived
Headers show
Series [v2,1/1] null_blk: Fix the problem "mutex_destroy missing" | expand

Commit Message

Zhu Yanjun April 25, 2024, 5:01 p.m. UTC
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>
---
 drivers/block/null_blk/main.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Jens Axboe April 25, 2024, 5:11 p.m. UTC | #1
On 4/25/24 11:01 AM, Zhu Yanjun wrote:
> When a mutex lock is not used any more, the function mutex_destroy
> should be called to mark the mutex lock uninitialized.

You didn't fix the title...
Zhu Yanjun April 25, 2024, 5:11 p.m. UTC | #2
OK. V3 is on the way.

Zhu Yanjun

在 2024/4/25 19:11, Jens Axboe 写道:
> On 4/25/24 11:01 AM, Zhu Yanjun wrote:
>> When a mutex lock is not used any more, the function mutex_destroy
>> should be called to mark the mutex lock uninitialized.
> You didn't fix the title...
>
diff mbox series

Patch

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);