diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/ipvs/ip_vs_sched.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv4/ipvs/ip_vs_sched.c b/net/ipv4/ipvs/ip_vs_sched.c index b64767309855..a46ad9e35016 100644 --- a/net/ipv4/ipvs/ip_vs_sched.c +++ b/net/ipv4/ipvs/ip_vs_sched.c | |||
@@ -184,7 +184,7 @@ int register_ip_vs_scheduler(struct ip_vs_scheduler *scheduler) | |||
184 | 184 | ||
185 | write_lock_bh(&__ip_vs_sched_lock); | 185 | write_lock_bh(&__ip_vs_sched_lock); |
186 | 186 | ||
187 | if (scheduler->n_list.next != &scheduler->n_list) { | 187 | if (!list_empty(&scheduler->n_list)) { |
188 | write_unlock_bh(&__ip_vs_sched_lock); | 188 | write_unlock_bh(&__ip_vs_sched_lock); |
189 | ip_vs_use_count_dec(); | 189 | ip_vs_use_count_dec(); |
190 | IP_VS_ERR("register_ip_vs_scheduler(): [%s] scheduler " | 190 | IP_VS_ERR("register_ip_vs_scheduler(): [%s] scheduler " |
@@ -229,7 +229,7 @@ int unregister_ip_vs_scheduler(struct ip_vs_scheduler *scheduler) | |||
229 | } | 229 | } |
230 | 230 | ||
231 | write_lock_bh(&__ip_vs_sched_lock); | 231 | write_lock_bh(&__ip_vs_sched_lock); |
232 | if (scheduler->n_list.next == &scheduler->n_list) { | 232 | if (list_empty(&scheduler->n_list)) { |
233 | write_unlock_bh(&__ip_vs_sched_lock); | 233 | write_unlock_bh(&__ip_vs_sched_lock); |
234 | IP_VS_ERR("unregister_ip_vs_scheduler(): [%s] scheduler " | 234 | IP_VS_ERR("unregister_ip_vs_scheduler(): [%s] scheduler " |
235 | "is not in the list. failed\n", scheduler->name); | 235 | "is not in the list. failed\n", scheduler->name); |