diff options
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/gt96100eth.h | 4 | ||||
-rw-r--r-- | drivers/net/hp100.c | 4 | ||||
-rw-r--r-- | drivers/net/ppp_deflate.c | 6 | ||||
-rw-r--r-- | drivers/net/ppp_generic.c | 12 | ||||
-rw-r--r-- | drivers/net/r8169.c | 2 | ||||
-rw-r--r-- | drivers/net/tg3.c | 12 | ||||
-rw-r--r-- | drivers/net/wan/cycx_x25.c | 8 | ||||
-rw-r--r-- | drivers/net/wan/pc300_tty.c | 27 | ||||
-rw-r--r-- | drivers/net/wan/sdla_chdlc.c | 13 | ||||
-rw-r--r-- | drivers/net/wan/x25_asy.c | 20 |
10 files changed, 40 insertions, 68 deletions
diff --git a/drivers/net/gt96100eth.h b/drivers/net/gt96100eth.h index 2f4bfd4dacbe..395869c5ed3e 100644 --- a/drivers/net/gt96100eth.h +++ b/drivers/net/gt96100eth.h | |||
@@ -214,7 +214,7 @@ typedef struct { | |||
214 | u32 cmdstat; | 214 | u32 cmdstat; |
215 | u32 next; | 215 | u32 next; |
216 | u32 buff_ptr; | 216 | u32 buff_ptr; |
217 | } gt96100_td_t __attribute__ ((packed)); | 217 | } __attribute__ ((packed)) gt96100_td_t; |
218 | 218 | ||
219 | typedef struct { | 219 | typedef struct { |
220 | #ifdef DESC_BE | 220 | #ifdef DESC_BE |
@@ -227,7 +227,7 @@ typedef struct { | |||
227 | u32 cmdstat; | 227 | u32 cmdstat; |
228 | u32 next; | 228 | u32 next; |
229 | u32 buff_ptr; | 229 | u32 buff_ptr; |
230 | } gt96100_rd_t __attribute__ ((packed)); | 230 | } __attribute__ ((packed)) gt96100_rd_t; |
231 | 231 | ||
232 | 232 | ||
233 | /* Values for the Tx command-status descriptor entry. */ | 233 | /* Values for the Tx command-status descriptor entry. */ |
diff --git a/drivers/net/hp100.c b/drivers/net/hp100.c index acb170152bbd..b3a898c5a585 100644 --- a/drivers/net/hp100.c +++ b/drivers/net/hp100.c | |||
@@ -13,8 +13,8 @@ | |||
13 | ** This driver has only been tested with | 13 | ** This driver has only been tested with |
14 | ** -- HP J2585B 10/100 Mbit/s PCI Busmaster | 14 | ** -- HP J2585B 10/100 Mbit/s PCI Busmaster |
15 | ** -- HP J2585A 10/100 Mbit/s PCI | 15 | ** -- HP J2585A 10/100 Mbit/s PCI |
16 | ** -- HP J2970 10 Mbit/s PCI Combo 10base-T/BNC | 16 | ** -- HP J2970A 10 Mbit/s PCI Combo 10base-T/BNC |
17 | ** -- HP J2973 10 Mbit/s PCI 10base-T | 17 | ** -- HP J2973A 10 Mbit/s PCI 10base-T |
18 | ** -- HP J2573 10/100 ISA | 18 | ** -- HP J2573 10/100 ISA |
19 | ** -- Compex ReadyLink ENET100-VG4 10/100 Mbit/s PCI / EISA | 19 | ** -- Compex ReadyLink ENET100-VG4 10/100 Mbit/s PCI / EISA |
20 | ** -- Compex FreedomLine 100/VG 10/100 Mbit/s ISA / EISA / PCI | 20 | ** -- Compex FreedomLine 100/VG 10/100 Mbit/s ISA / EISA / PCI |
diff --git a/drivers/net/ppp_deflate.c b/drivers/net/ppp_deflate.c index 507d6328d4eb..3872088fdd10 100644 --- a/drivers/net/ppp_deflate.c +++ b/drivers/net/ppp_deflate.c | |||
@@ -87,8 +87,7 @@ static void z_comp_free(void *arg) | |||
87 | 87 | ||
88 | if (state) { | 88 | if (state) { |
89 | zlib_deflateEnd(&state->strm); | 89 | zlib_deflateEnd(&state->strm); |
90 | if (state->strm.workspace) | 90 | vfree(state->strm.workspace); |
91 | vfree(state->strm.workspace); | ||
92 | kfree(state); | 91 | kfree(state); |
93 | } | 92 | } |
94 | } | 93 | } |
@@ -308,8 +307,7 @@ static void z_decomp_free(void *arg) | |||
308 | 307 | ||
309 | if (state) { | 308 | if (state) { |
310 | zlib_inflateEnd(&state->strm); | 309 | zlib_inflateEnd(&state->strm); |
311 | if (state->strm.workspace) | 310 | kfree(state->strm.workspace); |
312 | kfree(state->strm.workspace); | ||
313 | kfree(state); | 311 | kfree(state); |
314 | } | 312 | } |
315 | } | 313 | } |
diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c index c456dc81b873..3b377f6cd4a0 100644 --- a/drivers/net/ppp_generic.c +++ b/drivers/net/ppp_generic.c | |||
@@ -2467,14 +2467,10 @@ static void ppp_destroy_interface(struct ppp *ppp) | |||
2467 | skb_queue_purge(&ppp->mrq); | 2467 | skb_queue_purge(&ppp->mrq); |
2468 | #endif /* CONFIG_PPP_MULTILINK */ | 2468 | #endif /* CONFIG_PPP_MULTILINK */ |
2469 | #ifdef CONFIG_PPP_FILTER | 2469 | #ifdef CONFIG_PPP_FILTER |
2470 | if (ppp->pass_filter) { | 2470 | kfree(ppp->pass_filter); |
2471 | kfree(ppp->pass_filter); | 2471 | ppp->pass_filter = NULL; |
2472 | ppp->pass_filter = NULL; | 2472 | kfree(ppp->active_filter); |
2473 | } | 2473 | ppp->active_filter = NULL; |
2474 | if (ppp->active_filter) { | ||
2475 | kfree(ppp->active_filter); | ||
2476 | ppp->active_filter = NULL; | ||
2477 | } | ||
2478 | #endif /* CONFIG_PPP_FILTER */ | 2474 | #endif /* CONFIG_PPP_FILTER */ |
2479 | 2475 | ||
2480 | kfree(ppp); | 2476 | kfree(ppp); |
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index 07e2df09491f..c59507f8a76b 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c | |||
@@ -2385,7 +2385,7 @@ core_down: | |||
2385 | } | 2385 | } |
2386 | 2386 | ||
2387 | /* Give a racing hard_start_xmit a few cycles to complete. */ | 2387 | /* Give a racing hard_start_xmit a few cycles to complete. */ |
2388 | synchronize_kernel(); | 2388 | synchronize_sched(); /* FIXME: should this be synchronize_irq()? */ |
2389 | 2389 | ||
2390 | /* | 2390 | /* |
2391 | * And now for the 50k$ question: are IRQ disabled or not ? | 2391 | * And now for the 50k$ question: are IRQ disabled or not ? |
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index 903d0ced7ddb..058c70c6f1ac 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c | |||
@@ -5830,7 +5830,7 @@ static int tg3_test_interrupt(struct tg3 *tp) | |||
5830 | free_irq(tp->pdev->irq, dev); | 5830 | free_irq(tp->pdev->irq, dev); |
5831 | 5831 | ||
5832 | err = request_irq(tp->pdev->irq, tg3_test_isr, | 5832 | err = request_irq(tp->pdev->irq, tg3_test_isr, |
5833 | SA_SHIRQ, dev->name, dev); | 5833 | SA_SHIRQ | SA_SAMPLE_RANDOM, dev->name, dev); |
5834 | if (err) | 5834 | if (err) |
5835 | return err; | 5835 | return err; |
5836 | 5836 | ||
@@ -5852,10 +5852,10 @@ static int tg3_test_interrupt(struct tg3 *tp) | |||
5852 | 5852 | ||
5853 | if (tp->tg3_flags2 & TG3_FLG2_USING_MSI) | 5853 | if (tp->tg3_flags2 & TG3_FLG2_USING_MSI) |
5854 | err = request_irq(tp->pdev->irq, tg3_msi, | 5854 | err = request_irq(tp->pdev->irq, tg3_msi, |
5855 | 0, dev->name, dev); | 5855 | SA_SAMPLE_RANDOM, dev->name, dev); |
5856 | else | 5856 | else |
5857 | err = request_irq(tp->pdev->irq, tg3_interrupt, | 5857 | err = request_irq(tp->pdev->irq, tg3_interrupt, |
5858 | SA_SHIRQ, dev->name, dev); | 5858 | SA_SHIRQ | SA_SAMPLE_RANDOM, dev->name, dev); |
5859 | 5859 | ||
5860 | if (err) | 5860 | if (err) |
5861 | return err; | 5861 | return err; |
@@ -5908,7 +5908,7 @@ static int tg3_test_msi(struct tg3 *tp) | |||
5908 | tp->tg3_flags2 &= ~TG3_FLG2_USING_MSI; | 5908 | tp->tg3_flags2 &= ~TG3_FLG2_USING_MSI; |
5909 | 5909 | ||
5910 | err = request_irq(tp->pdev->irq, tg3_interrupt, | 5910 | err = request_irq(tp->pdev->irq, tg3_interrupt, |
5911 | SA_SHIRQ, dev->name, dev); | 5911 | SA_SHIRQ | SA_SAMPLE_RANDOM, dev->name, dev); |
5912 | 5912 | ||
5913 | if (err) | 5913 | if (err) |
5914 | return err; | 5914 | return err; |
@@ -5965,10 +5965,10 @@ static int tg3_open(struct net_device *dev) | |||
5965 | } | 5965 | } |
5966 | if (tp->tg3_flags2 & TG3_FLG2_USING_MSI) | 5966 | if (tp->tg3_flags2 & TG3_FLG2_USING_MSI) |
5967 | err = request_irq(tp->pdev->irq, tg3_msi, | 5967 | err = request_irq(tp->pdev->irq, tg3_msi, |
5968 | 0, dev->name, dev); | 5968 | SA_SAMPLE_RANDOM, dev->name, dev); |
5969 | else | 5969 | else |
5970 | err = request_irq(tp->pdev->irq, tg3_interrupt, | 5970 | err = request_irq(tp->pdev->irq, tg3_interrupt, |
5971 | SA_SHIRQ, dev->name, dev); | 5971 | SA_SHIRQ | SA_SAMPLE_RANDOM, dev->name, dev); |
5972 | 5972 | ||
5973 | if (err) { | 5973 | if (err) { |
5974 | if (tp->tg3_flags2 & TG3_FLG2_USING_MSI) { | 5974 | if (tp->tg3_flags2 & TG3_FLG2_USING_MSI) { |
diff --git a/drivers/net/wan/cycx_x25.c b/drivers/net/wan/cycx_x25.c index 5b48cd8568f5..02d57c0b4243 100644 --- a/drivers/net/wan/cycx_x25.c +++ b/drivers/net/wan/cycx_x25.c | |||
@@ -436,9 +436,7 @@ static int cycx_wan_new_if(struct wan_device *wandev, struct net_device *dev, | |||
436 | } | 436 | } |
437 | 437 | ||
438 | if (err) { | 438 | if (err) { |
439 | if (chan->local_addr) | 439 | kfree(chan->local_addr); |
440 | kfree(chan->local_addr); | ||
441 | |||
442 | kfree(chan); | 440 | kfree(chan); |
443 | return err; | 441 | return err; |
444 | } | 442 | } |
@@ -458,9 +456,7 @@ static int cycx_wan_del_if(struct wan_device *wandev, struct net_device *dev) | |||
458 | struct cycx_x25_channel *chan = dev->priv; | 456 | struct cycx_x25_channel *chan = dev->priv; |
459 | 457 | ||
460 | if (chan->svc) { | 458 | if (chan->svc) { |
461 | if (chan->local_addr) | 459 | kfree(chan->local_addr); |
462 | kfree(chan->local_addr); | ||
463 | |||
464 | if (chan->state == WAN_CONNECTED) | 460 | if (chan->state == WAN_CONNECTED) |
465 | del_timer(&chan->timer); | 461 | del_timer(&chan->timer); |
466 | } | 462 | } |
diff --git a/drivers/net/wan/pc300_tty.c b/drivers/net/wan/pc300_tty.c index 29f84ad08730..8454bf6caaa7 100644 --- a/drivers/net/wan/pc300_tty.c +++ b/drivers/net/wan/pc300_tty.c | |||
@@ -400,10 +400,8 @@ static void cpc_tty_close(struct tty_struct *tty, struct file *flip) | |||
400 | cpc_tty->buf_rx.last = NULL; | 400 | cpc_tty->buf_rx.last = NULL; |
401 | } | 401 | } |
402 | 402 | ||
403 | if (cpc_tty->buf_tx) { | 403 | kfree(cpc_tty->buf_tx); |
404 | kfree(cpc_tty->buf_tx); | 404 | cpc_tty->buf_tx = NULL; |
405 | cpc_tty->buf_tx = NULL; | ||
406 | } | ||
407 | 405 | ||
408 | CPC_TTY_DBG("%s: TTY closed\n",cpc_tty->name); | 406 | CPC_TTY_DBG("%s: TTY closed\n",cpc_tty->name); |
409 | 407 | ||
@@ -666,7 +664,7 @@ static void cpc_tty_rx_work(void * data) | |||
666 | unsigned long port; | 664 | unsigned long port; |
667 | int i, j; | 665 | int i, j; |
668 | st_cpc_tty_area *cpc_tty; | 666 | st_cpc_tty_area *cpc_tty; |
669 | volatile st_cpc_rx_buf * buf; | 667 | volatile st_cpc_rx_buf *buf; |
670 | char flags=0,flg_rx=1; | 668 | char flags=0,flg_rx=1; |
671 | struct tty_ldisc *ld; | 669 | struct tty_ldisc *ld; |
672 | 670 | ||
@@ -680,9 +678,9 @@ static void cpc_tty_rx_work(void * data) | |||
680 | cpc_tty = &cpc_tty_area[port]; | 678 | cpc_tty = &cpc_tty_area[port]; |
681 | 679 | ||
682 | if ((buf=cpc_tty->buf_rx.first) != 0) { | 680 | if ((buf=cpc_tty->buf_rx.first) != 0) { |
683 | if(cpc_tty->tty) { | 681 | if (cpc_tty->tty) { |
684 | ld = tty_ldisc_ref(cpc_tty->tty); | 682 | ld = tty_ldisc_ref(cpc_tty->tty); |
685 | if(ld) { | 683 | if (ld) { |
686 | if (ld->receive_buf) { | 684 | if (ld->receive_buf) { |
687 | CPC_TTY_DBG("%s: call line disc. receive_buf\n",cpc_tty->name); | 685 | CPC_TTY_DBG("%s: call line disc. receive_buf\n",cpc_tty->name); |
688 | ld->receive_buf(cpc_tty->tty, (char *)(buf->data), &flags, buf->size); | 686 | ld->receive_buf(cpc_tty->tty, (char *)(buf->data), &flags, buf->size); |
@@ -691,7 +689,7 @@ static void cpc_tty_rx_work(void * data) | |||
691 | } | 689 | } |
692 | } | 690 | } |
693 | cpc_tty->buf_rx.first = cpc_tty->buf_rx.first->next; | 691 | cpc_tty->buf_rx.first = cpc_tty->buf_rx.first->next; |
694 | kfree((unsigned char *)buf); | 692 | kfree(buf); |
695 | buf = cpc_tty->buf_rx.first; | 693 | buf = cpc_tty->buf_rx.first; |
696 | flg_rx = 1; | 694 | flg_rx = 1; |
697 | } | 695 | } |
@@ -733,7 +731,7 @@ static void cpc_tty_rx_disc_frame(pc300ch_t *pc300chan) | |||
733 | 731 | ||
734 | void cpc_tty_receive(pc300dev_t *pc300dev) | 732 | void cpc_tty_receive(pc300dev_t *pc300dev) |
735 | { | 733 | { |
736 | st_cpc_tty_area *cpc_tty; | 734 | st_cpc_tty_area *cpc_tty; |
737 | pc300ch_t *pc300chan = (pc300ch_t *)pc300dev->chan; | 735 | pc300ch_t *pc300chan = (pc300ch_t *)pc300dev->chan; |
738 | pc300_t *card = (pc300_t *)pc300chan->card; | 736 | pc300_t *card = (pc300_t *)pc300chan->card; |
739 | int ch = pc300chan->channel; | 737 | int ch = pc300chan->channel; |
@@ -742,7 +740,7 @@ void cpc_tty_receive(pc300dev_t *pc300dev) | |||
742 | int rx_len, rx_aux; | 740 | int rx_len, rx_aux; |
743 | volatile unsigned char status; | 741 | volatile unsigned char status; |
744 | unsigned short first_bd = pc300chan->rx_first_bd; | 742 | unsigned short first_bd = pc300chan->rx_first_bd; |
745 | st_cpc_rx_buf *new=NULL; | 743 | st_cpc_rx_buf *new = NULL; |
746 | unsigned char dsr_rx; | 744 | unsigned char dsr_rx; |
747 | 745 | ||
748 | if (pc300dev->cpc_tty == NULL) { | 746 | if (pc300dev->cpc_tty == NULL) { |
@@ -762,7 +760,7 @@ void cpc_tty_receive(pc300dev_t *pc300dev) | |||
762 | if (status & DST_EOM) { | 760 | if (status & DST_EOM) { |
763 | break; | 761 | break; |
764 | } | 762 | } |
765 | ptdescr=(pcsca_bd_t __iomem *)(card->hw.rambase+cpc_readl(&ptdescr->next)); | 763 | ptdescr = (pcsca_bd_t __iomem *)(card->hw.rambase+cpc_readl(&ptdescr->next)); |
766 | } | 764 | } |
767 | 765 | ||
768 | if (!rx_len) { | 766 | if (!rx_len) { |
@@ -771,10 +769,7 @@ void cpc_tty_receive(pc300dev_t *pc300dev) | |||
771 | cpc_writel(card->hw.scabase + DRX_REG(EDAL, ch), | 769 | cpc_writel(card->hw.scabase + DRX_REG(EDAL, ch), |
772 | RX_BD_ADDR(ch, pc300chan->rx_last_bd)); | 770 | RX_BD_ADDR(ch, pc300chan->rx_last_bd)); |
773 | } | 771 | } |
774 | if (new) { | 772 | kfree(new); |
775 | kfree(new); | ||
776 | new = NULL; | ||
777 | } | ||
778 | return; | 773 | return; |
779 | } | 774 | } |
780 | 775 | ||
@@ -787,7 +782,7 @@ void cpc_tty_receive(pc300dev_t *pc300dev) | |||
787 | continue; | 782 | continue; |
788 | } | 783 | } |
789 | 784 | ||
790 | new = (st_cpc_rx_buf *) kmalloc(rx_len + sizeof(st_cpc_rx_buf), GFP_ATOMIC); | 785 | new = (st_cpc_rx_buf *)kmalloc(rx_len + sizeof(st_cpc_rx_buf), GFP_ATOMIC); |
791 | if (new == 0) { | 786 | if (new == 0) { |
792 | cpc_tty_rx_disc_frame(pc300chan); | 787 | cpc_tty_rx_disc_frame(pc300chan); |
793 | continue; | 788 | continue; |
diff --git a/drivers/net/wan/sdla_chdlc.c b/drivers/net/wan/sdla_chdlc.c index afbe0024e3e1..496d29237e92 100644 --- a/drivers/net/wan/sdla_chdlc.c +++ b/drivers/net/wan/sdla_chdlc.c | |||
@@ -3664,15 +3664,10 @@ static void wanpipe_tty_close(struct tty_struct *tty, struct file * filp) | |||
3664 | chdlc_disable_comm_shutdown(card); | 3664 | chdlc_disable_comm_shutdown(card); |
3665 | unlock_adapter_irq(&card->wandev.lock,&smp_flags); | 3665 | unlock_adapter_irq(&card->wandev.lock,&smp_flags); |
3666 | 3666 | ||
3667 | if (card->tty_buf){ | 3667 | kfree(card->tty_buf); |
3668 | kfree(card->tty_buf); | 3668 | card->tty_buf = NULL; |
3669 | card->tty_buf=NULL; | 3669 | kfree(card->tty_rx); |
3670 | } | 3670 | card->tty_rx = NULL; |
3671 | |||
3672 | if (card->tty_rx){ | ||
3673 | kfree(card->tty_rx); | ||
3674 | card->tty_rx=NULL; | ||
3675 | } | ||
3676 | } | 3671 | } |
3677 | return; | 3672 | return; |
3678 | } | 3673 | } |
diff --git a/drivers/net/wan/x25_asy.c b/drivers/net/wan/x25_asy.c index 8c5cfcb55826..1c540d825551 100644 --- a/drivers/net/wan/x25_asy.c +++ b/drivers/net/wan/x25_asy.c | |||
@@ -107,13 +107,9 @@ static struct x25_asy *x25_asy_alloc(void) | |||
107 | static void x25_asy_free(struct x25_asy *sl) | 107 | static void x25_asy_free(struct x25_asy *sl) |
108 | { | 108 | { |
109 | /* Free all X.25 frame buffers. */ | 109 | /* Free all X.25 frame buffers. */ |
110 | if (sl->rbuff) { | 110 | kfree(sl->rbuff); |
111 | kfree(sl->rbuff); | ||
112 | } | ||
113 | sl->rbuff = NULL; | 111 | sl->rbuff = NULL; |
114 | if (sl->xbuff) { | 112 | kfree(sl->xbuff); |
115 | kfree(sl->xbuff); | ||
116 | } | ||
117 | sl->xbuff = NULL; | 113 | sl->xbuff = NULL; |
118 | 114 | ||
119 | if (!test_and_clear_bit(SLF_INUSE, &sl->flags)) { | 115 | if (!test_and_clear_bit(SLF_INUSE, &sl->flags)) { |
@@ -134,10 +130,8 @@ static int x25_asy_change_mtu(struct net_device *dev, int newmtu) | |||
134 | { | 130 | { |
135 | printk("%s: unable to grow X.25 buffers, MTU change cancelled.\n", | 131 | printk("%s: unable to grow X.25 buffers, MTU change cancelled.\n", |
136 | dev->name); | 132 | dev->name); |
137 | if (xbuff != NULL) | 133 | kfree(xbuff); |
138 | kfree(xbuff); | 134 | kfree(rbuff); |
139 | if (rbuff != NULL) | ||
140 | kfree(rbuff); | ||
141 | return -ENOMEM; | 135 | return -ENOMEM; |
142 | } | 136 | } |
143 | 137 | ||
@@ -169,10 +163,8 @@ static int x25_asy_change_mtu(struct net_device *dev, int newmtu) | |||
169 | 163 | ||
170 | spin_unlock_bh(&sl->lock); | 164 | spin_unlock_bh(&sl->lock); |
171 | 165 | ||
172 | if (xbuff != NULL) | 166 | kfree(xbuff); |
173 | kfree(xbuff); | 167 | kfree(rbuff); |
174 | if (rbuff != NULL) | ||
175 | kfree(rbuff); | ||
176 | return 0; | 168 | return 0; |
177 | } | 169 | } |
178 | 170 | ||