File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ int ___ratelimit(struct ratelimit_state *rs, const char *func)
33
33
int interval = READ_ONCE (rs -> interval );
34
34
int burst = READ_ONCE (rs -> burst );
35
35
unsigned long flags ;
36
- int ret ;
36
+ int ret = 0 ;
37
37
38
38
/*
39
39
* Zero interval says never limit, otherwise, non-positive burst
@@ -51,8 +51,6 @@ int ___ratelimit(struct ratelimit_state *rs, const char *func)
51
51
52
52
/* Force re-initialization once re-enabled. */
53
53
rs -> flags &= ~RATELIMIT_INITIALIZED ;
54
- if (!ret )
55
- ratelimit_state_inc_miss (rs );
56
54
goto unlock_ret ;
57
55
}
58
56
@@ -110,19 +108,17 @@ int ___ratelimit(struct ratelimit_state *rs, const char *func)
110
108
111
109
if (n_left > 0 ) {
112
110
n_left = atomic_dec_return (& rs -> rs_n_left );
113
- if (n_left >= 0 ) {
111
+ if (n_left >= 0 )
114
112
ret = 1 ;
115
- goto unlock_ret ;
116
- }
117
113
}
118
114
}
119
115
120
- ratelimit_state_inc_miss (rs );
121
- ret = 0 ;
122
-
123
116
unlock_ret :
124
117
raw_spin_unlock_irqrestore (& rs -> lock , flags );
125
118
119
+ if (!ret )
120
+ ratelimit_state_inc_miss (rs );
121
+
126
122
return ret ;
127
123
}
128
124
EXPORT_SYMBOL (___ratelimit );
You can’t perform that action at this time.
0 commit comments