Skip to content

Commit

Permalink
net: eql: add net device refcount tracker
Browse files Browse the repository at this point in the history
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Eric Dumazet authored and Jakub Kicinski committed Dec 8, 2021
1 parent 59d58d9 commit 08f0b22
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/eql.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ static void eql_kill_one_slave(slave_queue_t *queue, slave_t *slave)
list_del(&slave->list);
queue->num_slaves--;
slave->dev->flags &= ~IFF_SLAVE;
dev_put(slave->dev);
dev_put_track(slave->dev, &slave->dev_tracker);
kfree(slave);
}

Expand Down Expand Up @@ -399,7 +399,7 @@ static int __eql_insert_slave(slave_queue_t *queue, slave_t *slave)
if (duplicate_slave)
eql_kill_one_slave(queue, duplicate_slave);

dev_hold(slave->dev);
dev_hold_track(slave->dev, &slave->dev_tracker, GFP_ATOMIC);
list_add(&slave->list, &queue->all_slaves);
queue->num_slaves++;
slave->dev->flags |= IFF_SLAVE;
Expand Down
1 change: 1 addition & 0 deletions include/linux/if_eql.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
typedef struct slave {
struct list_head list;
struct net_device *dev;
netdevice_tracker dev_tracker;
long priority;
long priority_bps;
long priority_Bps;
Expand Down

0 comments on commit 08f0b22

Please sign in to comment.