File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ void down(struct semaphore *sem)
54
54
{
55
55
unsigned long flags ;
56
56
57
+ might_sleep ();
57
58
raw_spin_lock_irqsave (& sem -> lock , flags );
58
59
if (likely (sem -> count > 0 ))
59
60
sem -> count -- ;
@@ -77,6 +78,7 @@ int down_interruptible(struct semaphore *sem)
77
78
unsigned long flags ;
78
79
int result = 0 ;
79
80
81
+ might_sleep ();
80
82
raw_spin_lock_irqsave (& sem -> lock , flags );
81
83
if (likely (sem -> count > 0 ))
82
84
sem -> count -- ;
@@ -103,6 +105,7 @@ int down_killable(struct semaphore *sem)
103
105
unsigned long flags ;
104
106
int result = 0 ;
105
107
108
+ might_sleep ();
106
109
raw_spin_lock_irqsave (& sem -> lock , flags );
107
110
if (likely (sem -> count > 0 ))
108
111
sem -> count -- ;
@@ -157,6 +160,7 @@ int down_timeout(struct semaphore *sem, long timeout)
157
160
unsigned long flags ;
158
161
int result = 0 ;
159
162
163
+ might_sleep ();
160
164
raw_spin_lock_irqsave (& sem -> lock , flags );
161
165
if (likely (sem -> count > 0 ))
162
166
sem -> count -- ;
You can’t perform that action at this time.
0 commit comments