Skip to content

Commit

Permalink
watchdog: fix double lock in watchdog_nmi_enable_all
Browse files Browse the repository at this point in the history
Commit ab992dc ("watchdog: Fix merge 'conflict'") has introduced an
obvious deadlock because of a typo.  watchdog_proc_mutex should be
unlocked on exit.

Thanks to Miroslav Benes who was staring at the code with me and noticed
this.

Signed-off-by: Michal Hocko <mhocko@suse.cz>
Duh-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Michal Hocko authored and torvalds committed May 19, 2015
1 parent e260818 commit 1173ff0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/watchdog.c
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ void watchdog_nmi_enable_all(void)
put_online_cpus();

unlock:
mutex_lock(&watchdog_proc_mutex);
mutex_unlock(&watchdog_proc_mutex);
}

void watchdog_nmi_disable_all(void)
Expand Down

0 comments on commit 1173ff0

Please sign in to comment.