Showing error 1028

User: Jiri Slaby
Error type: Leaving function in locked state
Error type description: Some lock is not unlocked on all paths of a function, so it is leaked
File location: include/linux/netdevice.h
Line in file: 1570
Project: Linux Kernel
Project version: 2.6.28
Tools: Undetermined 1
Entered: 2012-03-04 17:07:06 UTC


Source:

1540        txq->xmit_lock_owner = -1;
1541        spin_unlock_bh(&txq->_xmit_lock);
1542}
1543
1544/**
1545 *        netif_tx_lock - grab network device transmit lock
1546 *        @dev: network device
1547 *
1548 * Get network device transmit lock
1549 */
1550static inline void netif_tx_lock(struct net_device *dev)
1551{
1552        unsigned int i;
1553        int cpu;
1554
1555        spin_lock(&dev->tx_global_lock);
1556        cpu = smp_processor_id();
1557        for (i = 0; i < dev->num_tx_queues; i++) {
1558                struct netdev_queue *txq = netdev_get_tx_queue(dev, i);
1559
1560                /* We are the only thread of execution doing a
1561                 * freeze, but we have to grab the _xmit_lock in
1562                 * order to synchronize with threads which are in
1563                 * the ->hard_start_xmit() handler and already
1564                 * checked the frozen bit.
1565                 */
1566                __netif_tx_lock(txq, cpu);
1567                set_bit(__QUEUE_STATE_FROZEN, &txq->state);
1568                __netif_tx_unlock(txq);
1569        }
1570}
1571
1572static inline void netif_tx_lock_bh(struct net_device *dev)
1573{
1574        local_bh_disable();
1575        netif_tx_lock(dev);
1576}
1577
1578static inline void netif_tx_unlock(struct net_device *dev)
1579{
1580        unsigned int i;
Show full sources