Commit 3b3291e8 authored by Marek Belisko's avatar Marek Belisko Committed by Greg Kroah-Hartman

staging: ft1000: Use common return point.

Signed-off-by: default avatarMarek Belisko <marek.belisko@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 35e9403b
...@@ -1121,14 +1121,13 @@ static int ft1000_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -1121,14 +1121,13 @@ static int ft1000_start_xmit(struct sk_buff *skb, struct net_device *dev)
if ( skb == NULL ) if ( skb == NULL )
{ {
DEBUG ("ft1000_hw: ft1000_start_xmit:skb == NULL!!!\n" ); DEBUG ("ft1000_hw: ft1000_start_xmit:skb == NULL!!!\n" );
return STATUS_FAILURE; return NETDEV_TX_OK;
} }
if ( pFt1000Dev->status & FT1000_STATUS_CLOSING) if ( pFt1000Dev->status & FT1000_STATUS_CLOSING)
{ {
DEBUG("network driver is closed, return\n"); DEBUG("network driver is closed, return\n");
dev_kfree_skb(skb); goto err;
return STATUS_SUCCESS;
} }
//DEBUG("ft1000_start_xmit 1:length of packet = %d\n", skb->len); //DEBUG("ft1000_start_xmit 1:length of packet = %d\n", skb->len);
...@@ -1147,28 +1146,24 @@ static int ft1000_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -1147,28 +1146,24 @@ static int ft1000_start_xmit(struct sk_buff *skb, struct net_device *dev)
{ {
/* Drop packet is mediastate is down */ /* Drop packet is mediastate is down */
DEBUG("ft1000_hw:ft1000_start_xmit:mediastate is down\n"); DEBUG("ft1000_hw:ft1000_start_xmit:mediastate is down\n");
dev_kfree_skb(skb); goto err;
return STATUS_SUCCESS;
} }
if ( (skb->len < ENET_HEADER_SIZE) || (skb->len > ENET_MAX_SIZE) ) if ( (skb->len < ENET_HEADER_SIZE) || (skb->len > ENET_MAX_SIZE) )
{ {
/* Drop packet which has invalid size */ /* Drop packet which has invalid size */
DEBUG("ft1000_hw:ft1000_start_xmit:invalid ethernet length\n"); DEBUG("ft1000_hw:ft1000_start_xmit:invalid ethernet length\n");
dev_kfree_skb(skb); goto err;
return STATUS_SUCCESS;
} }
//mbelian //mbelian
if(ft1000_copy_down_pkt (dev, (pdata+ENET_HEADER_SIZE-2), skb->len - ENET_HEADER_SIZE + 2) == STATUS_FAILURE) ft1000_copy_down_pkt(dev, (pdata+ENET_HEADER_SIZE-2),
{ skb->len - ENET_HEADER_SIZE + 2);
dev_kfree_skb(skb);
return STATUS_SUCCESS;
}
dev_kfree_skb(skb); err:
dev_kfree_skb(skb);
//DEBUG(" ft1000_start_xmit() exit\n"); //DEBUG(" ft1000_start_xmit() exit\n");
return 0; return NETDEV_TX_OK;
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment