aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@pobox.com>2005-10-05 02:11:33 -0400
committerJeff Garzik <jgarzik@pobox.com>2005-10-05 02:11:33 -0400
commit0d69ae5fb7eb9ba3b54cf0ba4ef5ae591f31eef7 (patch)
treebe441bfa1e76035c00b66a3b06fea66cfd63d594 /drivers/net
parent13d1ef29bc5125d7b77c5f6cdfde5ed31226005c (diff)
parent9bc39bec87ee3e35897fe27441e979e7c208f624 (diff)
Merge branch 'master'
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/tokenring/ibmtr.c5
-rw-r--r--drivers/net/wireless/orinoco.c14
2 files changed, 9 insertions, 10 deletions
diff --git a/drivers/net/tokenring/ibmtr.c b/drivers/net/tokenring/ibmtr.c
index 8154bbbb7792..9f491563944e 100644
--- a/drivers/net/tokenring/ibmtr.c
+++ b/drivers/net/tokenring/ibmtr.c
@@ -531,7 +531,6 @@ static int __devinit ibmtr_probe1(struct net_device *dev, int PIOaddr)
531 if (!time_after(jiffies, timeout)) continue; 531 if (!time_after(jiffies, timeout)) continue;
532 DPRINTK( "Hardware timeout during initialization.\n"); 532 DPRINTK( "Hardware timeout during initialization.\n");
533 iounmap(t_mmio); 533 iounmap(t_mmio);
534 kfree(ti);
535 return -ENODEV; 534 return -ENODEV;
536 } 535 }
537 ti->sram_phys = 536 ti->sram_phys =
@@ -645,7 +644,6 @@ static int __devinit ibmtr_probe1(struct net_device *dev, int PIOaddr)
645 DPRINTK("Unknown shared ram paging info %01X\n", 644 DPRINTK("Unknown shared ram paging info %01X\n",
646 ti->shared_ram_paging); 645 ti->shared_ram_paging);
647 iounmap(t_mmio); 646 iounmap(t_mmio);
648 kfree(ti);
649 return -ENODEV; 647 return -ENODEV;
650 break; 648 break;
651 } /*end switch shared_ram_paging */ 649 } /*end switch shared_ram_paging */
@@ -675,7 +673,6 @@ static int __devinit ibmtr_probe1(struct net_device *dev, int PIOaddr)
675 "driver limit (%05x), adapter not started.\n", 673 "driver limit (%05x), adapter not started.\n",
676 chk_base, ibmtr_mem_base + IBMTR_SHARED_RAM_SIZE); 674 chk_base, ibmtr_mem_base + IBMTR_SHARED_RAM_SIZE);
677 iounmap(t_mmio); 675 iounmap(t_mmio);
678 kfree(ti);
679 return -ENODEV; 676 return -ENODEV;
680 } else { /* seems cool, record what we have figured out */ 677 } else { /* seems cool, record what we have figured out */
681 ti->sram_base = new_base >> 12; 678 ti->sram_base = new_base >> 12;
@@ -690,7 +687,6 @@ static int __devinit ibmtr_probe1(struct net_device *dev, int PIOaddr)
690 DPRINTK("Could not grab irq %d. Halting Token Ring driver.\n", 687 DPRINTK("Could not grab irq %d. Halting Token Ring driver.\n",
691 irq); 688 irq);
692 iounmap(t_mmio); 689 iounmap(t_mmio);
693 kfree(ti);
694 return -ENODEV; 690 return -ENODEV;
695 } 691 }
696 /*?? Now, allocate some of the PIO PORTs for this driver.. */ 692 /*?? Now, allocate some of the PIO PORTs for this driver.. */
@@ -699,7 +695,6 @@ static int __devinit ibmtr_probe1(struct net_device *dev, int PIOaddr)
699 DPRINTK("Could not grab PIO range. Halting driver.\n"); 695 DPRINTK("Could not grab PIO range. Halting driver.\n");
700 free_irq(dev->irq, dev); 696 free_irq(dev->irq, dev);
701 iounmap(t_mmio); 697 iounmap(t_mmio);
702 kfree(ti);
703 return -EBUSY; 698 return -EBUSY;
704 } 699 }
705 700
diff --git a/drivers/net/wireless/orinoco.c b/drivers/net/wireless/orinoco.c
index 78afbc7f08be..da4c5e94a959 100644
--- a/drivers/net/wireless/orinoco.c
+++ b/drivers/net/wireless/orinoco.c
@@ -490,9 +490,14 @@ static int orinoco_xmit(struct sk_buff *skb, struct net_device *dev)
490 return 0; 490 return 0;
491 } 491 }
492 492
493 /* Length of the packet body */ 493 /* Check packet length, pad short packets, round up odd length */
494 /* FIXME: what if the skb is smaller than this? */ 494 len = max_t(int, ALIGN(skb->len, 2), ETH_ZLEN);
495 len = max_t(int,skb->len - ETH_HLEN, ETH_ZLEN - ETH_HLEN); 495 if (skb->len < len) {
496 skb = skb_padto(skb, len);
497 if (skb == NULL)
498 goto fail;
499 }
500 len -= ETH_HLEN;
496 501
497 eh = (struct ethhdr *)skb->data; 502 eh = (struct ethhdr *)skb->data;
498 503
@@ -544,8 +549,7 @@ static int orinoco_xmit(struct sk_buff *skb, struct net_device *dev)
544 p = skb->data; 549 p = skb->data;
545 } 550 }
546 551
547 /* Round up for odd length packets */ 552 err = hermes_bap_pwrite(hw, USER_BAP, p, data_len,
548 err = hermes_bap_pwrite(hw, USER_BAP, p, ALIGN(data_len, 2),
549 txfid, data_off); 553 txfid, data_off);
550 if (err) { 554 if (err) {
551 printk(KERN_ERR "%s: Error %d writing packet to BAP\n", 555 printk(KERN_ERR "%s: Error %d writing packet to BAP\n",