projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
99f02ef
)
lkdtm: avoid calling lkdtm_do_action() with spinlock held
author
Cong Wang
<
[email protected]
>
Fri, 3 Feb 2012 23:37:15 +0000
(15:37 -0800)
committer
Linus Torvalds
<
[email protected]
>
Sat, 4 Feb 2012 00:16:41 +0000
(16:16 -0800)
lkdtm_do_action() may call sleeping functions like kmalloc(), so do not
call it with spin lock held.
Signed-off-by: WANG Cong <
[email protected]
>
Cc: Prarit Bhargava <
[email protected]
>
Cc: Arnd Bergmann <
[email protected]
>
Cc: Greg Kroah-Hartman <
[email protected]
>
Reviewed-by: Dave Young <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
drivers/misc/lkdtm.c
patch
|
blob
|
history
diff --git
a/drivers/misc/lkdtm.c
b/drivers/misc/lkdtm.c
index 150cd7061b808019d4a775ab29fc287558d7508e..28adefe70f96274c93198ee50acc9ee65adec1ae 100644
(file)
--- a/
drivers/misc/lkdtm.c
+++ b/
drivers/misc/lkdtm.c
@@
-354,6
+354,7
@@
static void lkdtm_do_action(enum ctype which)
static void lkdtm_handler(void)
{
unsigned long flags;
+ bool do_it = false;
spin_lock_irqsave(&count_lock, flags);
count--;
@@
-361,10
+362,13
@@
static void lkdtm_handler(void)
cp_name_to_str(cpoint), cp_type_to_str(cptype), count);
if (count == 0) {
-
lkdtm_do_action(cptype)
;
+
do_it = true
;
count = cpoint_count;
}
spin_unlock_irqrestore(&count_lock, flags);
+
+ if (do_it)
+ lkdtm_do_action(cptype);
}
static int lkdtm_register_cpoint(enum cname which)