Skip to content

Commit

Permalink
[NET]: Fix reversed error test in netif_tx_trylock
Browse files Browse the repository at this point in the history
A non-zero return value indicates success from spin_trylock,
not error.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Herbert Xu authored and David S. Miller committed Jul 21, 2006
1 parent bf9915c commit 53c4b2c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/linux/netdevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -924,10 +924,10 @@ static inline void netif_tx_lock_bh(struct net_device *dev)

static inline int netif_tx_trylock(struct net_device *dev)
{
int err = spin_trylock(&dev->_xmit_lock);
if (!err)
int ok = spin_trylock(&dev->_xmit_lock);
if (likely(ok))
dev->xmit_lock_owner = smp_processor_id();
return err;
return ok;
}

static inline void netif_tx_unlock(struct net_device *dev)
Expand Down

0 comments on commit 53c4b2c

Please sign in to comment.