net: allwinner: Fix use correct return type for ndo_start_xmit()
The method ndo_start_xmit() returns a value of type netdev_tx_t. Fix the ndo function to use the correct type. And emac_start_xmit() can leak one skb if 'channel' == 3. Signed-off-by: Yunjian Wang <wangyunjian@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
354d861417
commit
09f6c44aaa
@ -417,7 +417,7 @@ static void emac_timeout(struct net_device *dev, unsigned int txqueue)
|
|||||||
/* Hardware start transmission.
|
/* Hardware start transmission.
|
||||||
* Send a packet to media from the upper layer.
|
* Send a packet to media from the upper layer.
|
||||||
*/
|
*/
|
||||||
static int emac_start_xmit(struct sk_buff *skb, struct net_device *dev)
|
static netdev_tx_t emac_start_xmit(struct sk_buff *skb, struct net_device *dev)
|
||||||
{
|
{
|
||||||
struct emac_board_info *db = netdev_priv(dev);
|
struct emac_board_info *db = netdev_priv(dev);
|
||||||
unsigned long channel;
|
unsigned long channel;
|
||||||
@ -425,7 +425,7 @@ static int emac_start_xmit(struct sk_buff *skb, struct net_device *dev)
|
|||||||
|
|
||||||
channel = db->tx_fifo_stat & 3;
|
channel = db->tx_fifo_stat & 3;
|
||||||
if (channel == 3)
|
if (channel == 3)
|
||||||
return 1;
|
return NETDEV_TX_BUSY;
|
||||||
|
|
||||||
channel = (channel == 1 ? 1 : 0);
|
channel = (channel == 1 ? 1 : 0);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user