From b15bbdb5d8b3de010269a4474f75d6284363df7d Mon Sep 17 00:00:00 2001 From: Vyacheslav Cherkashin Date: Mon, 19 Aug 2013 11:28:56 +0400 Subject: [PATCH] [FIX] deadlock, when rmmod swap_us_manager --- us_manager/us_manager.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/us_manager/us_manager.c b/us_manager/us_manager.c index f8b60d2..80c1b70 100644 --- a/us_manager/us_manager.c +++ b/us_manager/us_manager.c @@ -182,7 +182,7 @@ static int do_usm_start(void) int usm_stop(void) { - down(&mutex_inst); + mutex_lock(&mutex_inst); if (flag_inst == 0) goto unlock; @@ -190,7 +190,7 @@ int usm_stop(void) flag_inst = 0; unlock: - up(&mutex_inst); + mutex_unlock(&mutex_inst); return 0; } @@ -200,7 +200,7 @@ int usm_start(void) { int ret; - down(&mutex_inst); + mutex_lock(&mutex_inst); if (flag_inst) goto unlock; @@ -209,7 +209,7 @@ int usm_start(void) flag_inst = 1; unlock: - up(&mutex_inst); + mutex_unlock(&mutex_inst); return ret; } @@ -230,10 +230,10 @@ static int __init init_us_manager(void) static void __exit exit_us_manager(void) { - down(&mutex_inst); + mutex_lock(&mutex_inst); if (flag_inst) do_usm_stop(); - up(&mutex_inst); + mutex_unlock(&mutex_inst); uninit_msg(); uninit_helper(); -- 2.7.4