提交 53c4b2cc 编写于 作者: H Herbert Xu 提交者: David S. Miller

[NET]: Fix reversed error test in netif_tx_trylock

A non-zero return value indicates success from spin_trylock,
not error.
Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 bf9915cc
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册