Skip to content

Commit 8548c84

Browse files
Sathesh B Edarakuba-moo
authored andcommitted
octeon_ep_vf: Resolve netdevice usage count issue
The netdevice usage count increases during transmit queue timeouts because netdev_hold is called in ndo_tx_timeout, scheduling a task to reinitialize the card. Although netdev_put is called at the end of the scheduled work, rtnl_unlock checks the reference count during cleanup. This could cause issues if transmit timeout is called on multiple queues. Fixes: cb7dd71 ("octeon_ep_vf: Add driver framework and device initialization") Signed-off-by: Sathesh B Edara <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 765f253 commit 8548c84

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_main.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,9 @@ static void octep_vf_tx_timeout(struct net_device *netdev, unsigned int txqueue)
835835
struct octep_vf_device *oct = netdev_priv(netdev);
836836

837837
netdev_hold(netdev, NULL, GFP_ATOMIC);
838-
schedule_work(&oct->tx_timeout_task);
838+
if (!schedule_work(&oct->tx_timeout_task))
839+
netdev_put(netdev, NULL);
840+
839841
}
840842

841843
static int octep_vf_set_mac(struct net_device *netdev, void *p)

0 commit comments

Comments
 (0)