diff options
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/hamradio/bpqether.c | 2 | ||||
-rw-r--r-- | drivers/net/hp100.c | 35 | ||||
-rw-r--r-- | drivers/net/wan/lapbether.c | 16 |
3 files changed, 23 insertions, 30 deletions
diff --git a/drivers/net/hamradio/bpqether.c b/drivers/net/hamradio/bpqether.c index 5105548ad50c..abcd19a8bff9 100644 --- a/drivers/net/hamradio/bpqether.c +++ b/drivers/net/hamradio/bpqether.c | |||
@@ -260,7 +260,7 @@ static int bpq_xmit(struct sk_buff *skb, struct net_device *dev) | |||
260 | */ | 260 | */ |
261 | if (!netif_running(dev)) { | 261 | if (!netif_running(dev)) { |
262 | kfree_skb(skb); | 262 | kfree_skb(skb); |
263 | return -ENODEV; | 263 | return NETDEV_TX_OK; |
264 | } | 264 | } |
265 | 265 | ||
266 | skb_pull(skb, 1); | 266 | skb_pull(skb, 1); |
diff --git a/drivers/net/hp100.c b/drivers/net/hp100.c index 8feda9fe8297..1d3429a415e6 100644 --- a/drivers/net/hp100.c +++ b/drivers/net/hp100.c | |||
@@ -1495,13 +1495,8 @@ static int hp100_start_xmit_bm(struct sk_buff *skb, struct net_device *dev) | |||
1495 | hp100_outw(0x4210, TRACE); | 1495 | hp100_outw(0x4210, TRACE); |
1496 | printk("hp100: %s: start_xmit_bm\n", dev->name); | 1496 | printk("hp100: %s: start_xmit_bm\n", dev->name); |
1497 | #endif | 1497 | #endif |
1498 | |||
1499 | if (skb == NULL) { | ||
1500 | return 0; | ||
1501 | } | ||
1502 | |||
1503 | if (skb->len <= 0) | 1498 | if (skb->len <= 0) |
1504 | return 0; | 1499 | goto drop; |
1505 | 1500 | ||
1506 | if (lp->chip == HP100_CHIPID_SHASTA && skb_padto(skb, ETH_ZLEN)) | 1501 | if (lp->chip == HP100_CHIPID_SHASTA && skb_padto(skb, ETH_ZLEN)) |
1507 | return 0; | 1502 | return 0; |
@@ -1514,10 +1509,10 @@ static int hp100_start_xmit_bm(struct sk_buff *skb, struct net_device *dev) | |||
1514 | #endif | 1509 | #endif |
1515 | /* not waited long enough since last tx? */ | 1510 | /* not waited long enough since last tx? */ |
1516 | if (time_before(jiffies, dev->trans_start + HZ)) | 1511 | if (time_before(jiffies, dev->trans_start + HZ)) |
1517 | return -EAGAIN; | 1512 | goto drop; |
1518 | 1513 | ||
1519 | if (hp100_check_lan(dev)) | 1514 | if (hp100_check_lan(dev)) |
1520 | return -EIO; | 1515 | goto drop; |
1521 | 1516 | ||
1522 | if (lp->lan_type == HP100_LAN_100 && lp->hub_status < 0) { | 1517 | if (lp->lan_type == HP100_LAN_100 && lp->hub_status < 0) { |
1523 | /* we have a 100Mb/s adapter but it isn't connected to hub */ | 1518 | /* we have a 100Mb/s adapter but it isn't connected to hub */ |
@@ -1551,7 +1546,7 @@ static int hp100_start_xmit_bm(struct sk_buff *skb, struct net_device *dev) | |||
1551 | } | 1546 | } |
1552 | 1547 | ||
1553 | dev->trans_start = jiffies; | 1548 | dev->trans_start = jiffies; |
1554 | return -EAGAIN; | 1549 | goto drop; |
1555 | } | 1550 | } |
1556 | 1551 | ||
1557 | /* | 1552 | /* |
@@ -1591,6 +1586,10 @@ static int hp100_start_xmit_bm(struct sk_buff *skb, struct net_device *dev) | |||
1591 | dev->trans_start = jiffies; | 1586 | dev->trans_start = jiffies; |
1592 | 1587 | ||
1593 | return 0; | 1588 | return 0; |
1589 | |||
1590 | drop: | ||
1591 | dev_kfree_skb(skb); | ||
1592 | return NETDEV_TX_OK; | ||
1594 | } | 1593 | } |
1595 | 1594 | ||
1596 | 1595 | ||
@@ -1648,16 +1647,11 @@ static int hp100_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1648 | hp100_outw(0x4212, TRACE); | 1647 | hp100_outw(0x4212, TRACE); |
1649 | printk("hp100: %s: start_xmit\n", dev->name); | 1648 | printk("hp100: %s: start_xmit\n", dev->name); |
1650 | #endif | 1649 | #endif |
1651 | |||
1652 | if (skb == NULL) { | ||
1653 | return 0; | ||
1654 | } | ||
1655 | |||
1656 | if (skb->len <= 0) | 1650 | if (skb->len <= 0) |
1657 | return 0; | 1651 | goto drop; |
1658 | 1652 | ||
1659 | if (hp100_check_lan(dev)) | 1653 | if (hp100_check_lan(dev)) |
1660 | return -EIO; | 1654 | goto drop; |
1661 | 1655 | ||
1662 | /* If there is not enough free memory on the card... */ | 1656 | /* If there is not enough free memory on the card... */ |
1663 | i = hp100_inl(TX_MEM_FREE) & 0x7fffffff; | 1657 | i = hp100_inl(TX_MEM_FREE) & 0x7fffffff; |
@@ -1671,7 +1665,7 @@ static int hp100_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1671 | printk("hp100: %s: trans_start timing problem\n", | 1665 | printk("hp100: %s: trans_start timing problem\n", |
1672 | dev->name); | 1666 | dev->name); |
1673 | #endif | 1667 | #endif |
1674 | return -EAGAIN; | 1668 | goto drop; |
1675 | } | 1669 | } |
1676 | if (lp->lan_type == HP100_LAN_100 && lp->hub_status < 0) { | 1670 | if (lp->lan_type == HP100_LAN_100 && lp->hub_status < 0) { |
1677 | /* we have a 100Mb/s adapter but it isn't connected to hub */ | 1671 | /* we have a 100Mb/s adapter but it isn't connected to hub */ |
@@ -1705,7 +1699,7 @@ static int hp100_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1705 | } | 1699 | } |
1706 | } | 1700 | } |
1707 | dev->trans_start = jiffies; | 1701 | dev->trans_start = jiffies; |
1708 | return -EAGAIN; | 1702 | goto drop; |
1709 | } | 1703 | } |
1710 | 1704 | ||
1711 | for (i = 0; i < 6000 && (hp100_inb(OPTION_MSW) & HP100_TX_CMD); i++) { | 1705 | for (i = 0; i < 6000 && (hp100_inb(OPTION_MSW) & HP100_TX_CMD); i++) { |
@@ -1759,6 +1753,11 @@ static int hp100_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1759 | #endif | 1753 | #endif |
1760 | 1754 | ||
1761 | return 0; | 1755 | return 0; |
1756 | |||
1757 | drop: | ||
1758 | dev_kfree_skb(skb); | ||
1759 | return NETDEV_TX_OK; | ||
1760 | |||
1762 | } | 1761 | } |
1763 | 1762 | ||
1764 | 1763 | ||
diff --git a/drivers/net/wan/lapbether.c b/drivers/net/wan/lapbether.c index 2dd78d20eb05..aff4f6bdf3d5 100644 --- a/drivers/net/wan/lapbether.c +++ b/drivers/net/wan/lapbether.c | |||
@@ -149,46 +149,40 @@ static int lapbeth_data_indication(struct net_device *dev, struct sk_buff *skb) | |||
149 | */ | 149 | */ |
150 | static int lapbeth_xmit(struct sk_buff *skb, struct net_device *dev) | 150 | static int lapbeth_xmit(struct sk_buff *skb, struct net_device *dev) |
151 | { | 151 | { |
152 | int err = -ENODEV; | 152 | int err; |
153 | 153 | ||
154 | /* | 154 | /* |
155 | * Just to be *really* sure not to send anything if the interface | 155 | * Just to be *really* sure not to send anything if the interface |
156 | * is down, the ethernet device may have gone. | 156 | * is down, the ethernet device may have gone. |
157 | */ | 157 | */ |
158 | if (!netif_running(dev)) { | 158 | if (!netif_running(dev)) |
159 | goto drop; | 159 | goto drop; |
160 | } | ||
161 | 160 | ||
162 | switch (skb->data[0]) { | 161 | switch (skb->data[0]) { |
163 | case 0x00: | 162 | case 0x00: |
164 | err = 0; | ||
165 | break; | 163 | break; |
166 | case 0x01: | 164 | case 0x01: |
167 | if ((err = lapb_connect_request(dev)) != LAPB_OK) | 165 | if ((err = lapb_connect_request(dev)) != LAPB_OK) |
168 | printk(KERN_ERR "lapbeth: lapb_connect_request " | 166 | printk(KERN_ERR "lapbeth: lapb_connect_request " |
169 | "error: %d\n", err); | 167 | "error: %d\n", err); |
170 | goto drop_ok; | 168 | goto drop; |
171 | case 0x02: | 169 | case 0x02: |
172 | if ((err = lapb_disconnect_request(dev)) != LAPB_OK) | 170 | if ((err = lapb_disconnect_request(dev)) != LAPB_OK) |
173 | printk(KERN_ERR "lapbeth: lapb_disconnect_request " | 171 | printk(KERN_ERR "lapbeth: lapb_disconnect_request " |
174 | "err: %d\n", err); | 172 | "err: %d\n", err); |
175 | /* Fall thru */ | 173 | /* Fall thru */ |
176 | default: | 174 | default: |
177 | goto drop_ok; | 175 | goto drop; |
178 | } | 176 | } |
179 | 177 | ||
180 | skb_pull(skb, 1); | 178 | skb_pull(skb, 1); |
181 | 179 | ||
182 | if ((err = lapb_data_request(dev, skb)) != LAPB_OK) { | 180 | if ((err = lapb_data_request(dev, skb)) != LAPB_OK) { |
183 | printk(KERN_ERR "lapbeth: lapb_data_request error - %d\n", err); | 181 | printk(KERN_ERR "lapbeth: lapb_data_request error - %d\n", err); |
184 | err = -ENOMEM; | ||
185 | goto drop; | 182 | goto drop; |
186 | } | 183 | } |
187 | err = 0; | ||
188 | out: | 184 | out: |
189 | return err; | 185 | return NETDEV_TX_OK; |
190 | drop_ok: | ||
191 | err = 0; | ||
192 | drop: | 186 | drop: |
193 | kfree_skb(skb); | 187 | kfree_skb(skb); |
194 | goto out; | 188 | goto out; |