diff options
author | Loic Le Loarer <loic.le-loarer+lk@polytechnique.org> | 2005-07-21 17:16:54 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2005-07-21 17:16:54 -0400 |
commit | 14a59e1829cd5782ad1a8979e594578f49f3e2c1 (patch) | |
tree | b2aa664412afa2c2a5eef47d485b11c410949798 /drivers/net | |
parent | 4acdbdbe5089c06d5e0c7e96783fcc4414ded00a (diff) |
[EQL]: Proper num_slaves decrement
Signed-off-by: Loic Le Loarer <loic.le-loarer+lk@polytechnique.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/eql.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/net/eql.c b/drivers/net/eql.c index dd6865820372..aa1569182fd6 100644 --- a/drivers/net/eql.c +++ b/drivers/net/eql.c | |||
@@ -132,7 +132,7 @@ static struct net_device_stats *eql_get_stats(struct net_device *dev); | |||
132 | #define eql_is_slave(dev) ((dev->flags & IFF_SLAVE) == IFF_SLAVE) | 132 | #define eql_is_slave(dev) ((dev->flags & IFF_SLAVE) == IFF_SLAVE) |
133 | #define eql_is_master(dev) ((dev->flags & IFF_MASTER) == IFF_MASTER) | 133 | #define eql_is_master(dev) ((dev->flags & IFF_MASTER) == IFF_MASTER) |
134 | 134 | ||
135 | static void eql_kill_one_slave(slave_t *slave); | 135 | static void eql_kill_one_slave(slave_queue_t *queue, slave_t *slave); |
136 | 136 | ||
137 | static void eql_timer(unsigned long param) | 137 | static void eql_timer(unsigned long param) |
138 | { | 138 | { |
@@ -149,7 +149,7 @@ static void eql_timer(unsigned long param) | |||
149 | if (slave->bytes_queued < 0) | 149 | if (slave->bytes_queued < 0) |
150 | slave->bytes_queued = 0; | 150 | slave->bytes_queued = 0; |
151 | } else { | 151 | } else { |
152 | eql_kill_one_slave(slave); | 152 | eql_kill_one_slave(&eql->queue, slave); |
153 | } | 153 | } |
154 | 154 | ||
155 | } | 155 | } |
@@ -214,9 +214,10 @@ static int eql_open(struct net_device *dev) | |||
214 | return 0; | 214 | return 0; |
215 | } | 215 | } |
216 | 216 | ||
217 | static void eql_kill_one_slave(slave_t *slave) | 217 | static void eql_kill_one_slave(slave_queue_t *queue, slave_t *slave) |
218 | { | 218 | { |
219 | list_del(&slave->list); | 219 | list_del(&slave->list); |
220 | queue->num_slaves--; | ||
220 | slave->dev->flags &= ~IFF_SLAVE; | 221 | slave->dev->flags &= ~IFF_SLAVE; |
221 | dev_put(slave->dev); | 222 | dev_put(slave->dev); |
222 | kfree(slave); | 223 | kfree(slave); |
@@ -232,8 +233,7 @@ static void eql_kill_slave_queue(slave_queue_t *queue) | |||
232 | list_for_each_safe(this, tmp, head) { | 233 | list_for_each_safe(this, tmp, head) { |
233 | slave_t *s = list_entry(this, slave_t, list); | 234 | slave_t *s = list_entry(this, slave_t, list); |
234 | 235 | ||
235 | eql_kill_one_slave(s); | 236 | eql_kill_one_slave(queue, s); |
236 | queue->num_slaves--; | ||
237 | } | 237 | } |
238 | 238 | ||
239 | spin_unlock_bh(&queue->lock); | 239 | spin_unlock_bh(&queue->lock); |
@@ -318,7 +318,7 @@ static slave_t *__eql_schedule_slaves(slave_queue_t *queue) | |||
318 | } | 318 | } |
319 | } else { | 319 | } else { |
320 | /* We found a dead slave, kill it. */ | 320 | /* We found a dead slave, kill it. */ |
321 | eql_kill_one_slave(slave); | 321 | eql_kill_one_slave(queue, slave); |
322 | } | 322 | } |
323 | } | 323 | } |
324 | return best_slave; | 324 | return best_slave; |
@@ -393,7 +393,7 @@ static int __eql_insert_slave(slave_queue_t *queue, slave_t *slave) | |||
393 | 393 | ||
394 | duplicate_slave = __eql_find_slave_dev(queue, slave->dev); | 394 | duplicate_slave = __eql_find_slave_dev(queue, slave->dev); |
395 | if (duplicate_slave != 0) | 395 | if (duplicate_slave != 0) |
396 | eql_kill_one_slave(duplicate_slave); | 396 | eql_kill_one_slave(queue, duplicate_slave); |
397 | 397 | ||
398 | list_add(&slave->list, &queue->all_slaves); | 398 | list_add(&slave->list, &queue->all_slaves); |
399 | queue->num_slaves++; | 399 | queue->num_slaves++; |
@@ -471,7 +471,7 @@ static int eql_emancipate(struct net_device *master_dev, slaving_request_t __use | |||
471 | slave_dev); | 471 | slave_dev); |
472 | 472 | ||
473 | if (slave) { | 473 | if (slave) { |
474 | eql_kill_one_slave(slave); | 474 | eql_kill_one_slave(&eql->queue, slave); |
475 | ret = 0; | 475 | ret = 0; |
476 | } | 476 | } |
477 | } | 477 | } |