diff options
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/airo.c | 48 | ||||
-rw-r--r-- | drivers/net/wireless/airo_cs.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/atmel.c | 6 | ||||
-rw-r--r-- | drivers/net/wireless/atmel_cs.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/hermes.c | 38 | ||||
-rw-r--r-- | drivers/net/wireless/hermes.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/hostap/hostap_ioctl.c | 9 | ||||
-rw-r--r-- | drivers/net/wireless/ipw2200.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/orinoco.c | 13 | ||||
-rw-r--r-- | drivers/net/wireless/prism54/islpci_dev.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/prism54/islpci_eth.c | 13 | ||||
-rw-r--r-- | drivers/net/wireless/prism54/oid_mgt.c | 9 | ||||
-rw-r--r-- | drivers/net/wireless/strip.c | 38 |
13 files changed, 101 insertions, 89 deletions
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c index cb429e783749..4c11699bad91 100644 --- a/drivers/net/wireless/airo.c +++ b/drivers/net/wireless/airo.c | |||
@@ -2381,14 +2381,10 @@ void stop_airo_card( struct net_device *dev, int freeres ) | |||
2381 | dev_kfree_skb(skb); | 2381 | dev_kfree_skb(skb); |
2382 | } | 2382 | } |
2383 | 2383 | ||
2384 | if (ai->flash) | 2384 | kfree(ai->flash); |
2385 | kfree(ai->flash); | 2385 | kfree(ai->rssi); |
2386 | if (ai->rssi) | 2386 | kfree(ai->APList); |
2387 | kfree(ai->rssi); | 2387 | kfree(ai->SSID); |
2388 | if (ai->APList) | ||
2389 | kfree(ai->APList); | ||
2390 | if (ai->SSID) | ||
2391 | kfree(ai->SSID); | ||
2392 | if (freeres) { | 2388 | if (freeres) { |
2393 | /* PCMCIA frees this stuff, so only for PCI and ISA */ | 2389 | /* PCMCIA frees this stuff, so only for PCI and ISA */ |
2394 | release_region( dev->base_addr, 64 ); | 2390 | release_region( dev->base_addr, 64 ); |
@@ -3626,10 +3622,8 @@ static u16 setup_card(struct airo_info *ai, u8 *mac, int lock) | |||
3626 | int rc; | 3622 | int rc; |
3627 | 3623 | ||
3628 | memset( &mySsid, 0, sizeof( mySsid ) ); | 3624 | memset( &mySsid, 0, sizeof( mySsid ) ); |
3629 | if (ai->flash) { | 3625 | kfree (ai->flash); |
3630 | kfree (ai->flash); | 3626 | ai->flash = NULL; |
3631 | ai->flash = NULL; | ||
3632 | } | ||
3633 | 3627 | ||
3634 | /* The NOP is the first step in getting the card going */ | 3628 | /* The NOP is the first step in getting the card going */ |
3635 | cmd.cmd = NOP; | 3629 | cmd.cmd = NOP; |
@@ -3666,14 +3660,10 @@ static u16 setup_card(struct airo_info *ai, u8 *mac, int lock) | |||
3666 | tdsRssiRid rssi_rid; | 3660 | tdsRssiRid rssi_rid; |
3667 | CapabilityRid cap_rid; | 3661 | CapabilityRid cap_rid; |
3668 | 3662 | ||
3669 | if (ai->APList) { | 3663 | kfree(ai->APList); |
3670 | kfree(ai->APList); | 3664 | ai->APList = NULL; |
3671 | ai->APList = NULL; | 3665 | kfree(ai->SSID); |
3672 | } | 3666 | ai->SSID = NULL; |
3673 | if (ai->SSID) { | ||
3674 | kfree(ai->SSID); | ||
3675 | ai->SSID = NULL; | ||
3676 | } | ||
3677 | // general configuration (read/modify/write) | 3667 | // general configuration (read/modify/write) |
3678 | status = readConfigRid(ai, lock); | 3668 | status = readConfigRid(ai, lock); |
3679 | if ( status != SUCCESS ) return ERROR; | 3669 | if ( status != SUCCESS ) return ERROR; |
@@ -3687,10 +3677,8 @@ static u16 setup_card(struct airo_info *ai, u8 *mac, int lock) | |||
3687 | memcpy(ai->rssi, (u8*)&rssi_rid + 2, 512); /* Skip RID length member */ | 3677 | memcpy(ai->rssi, (u8*)&rssi_rid + 2, 512); /* Skip RID length member */ |
3688 | } | 3678 | } |
3689 | else { | 3679 | else { |
3690 | if (ai->rssi) { | 3680 | kfree(ai->rssi); |
3691 | kfree(ai->rssi); | 3681 | ai->rssi = NULL; |
3692 | ai->rssi = NULL; | ||
3693 | } | ||
3694 | if (cap_rid.softCap & 8) | 3682 | if (cap_rid.softCap & 8) |
3695 | ai->config.rmode |= RXMODE_NORMALIZED_RSSI; | 3683 | ai->config.rmode |= RXMODE_NORMALIZED_RSSI; |
3696 | else | 3684 | else |
@@ -5369,11 +5357,13 @@ static int proc_BSSList_open( struct inode *inode, struct file *file ) { | |||
5369 | 5357 | ||
5370 | static int proc_close( struct inode *inode, struct file *file ) | 5358 | static int proc_close( struct inode *inode, struct file *file ) |
5371 | { | 5359 | { |
5372 | struct proc_data *data = (struct proc_data *)file->private_data; | 5360 | struct proc_data *data = file->private_data; |
5373 | if ( data->on_close != NULL ) data->on_close( inode, file ); | 5361 | |
5374 | if ( data->rbuffer ) kfree( data->rbuffer ); | 5362 | if (data->on_close != NULL) |
5375 | if ( data->wbuffer ) kfree( data->wbuffer ); | 5363 | data->on_close(inode, file); |
5376 | kfree( data ); | 5364 | kfree(data->rbuffer); |
5365 | kfree(data->wbuffer); | ||
5366 | kfree(data); | ||
5377 | return 0; | 5367 | return 0; |
5378 | } | 5368 | } |
5379 | 5369 | ||
diff --git a/drivers/net/wireless/airo_cs.c b/drivers/net/wireless/airo_cs.c index bf25584d68d3..784de9109113 100644 --- a/drivers/net/wireless/airo_cs.c +++ b/drivers/net/wireless/airo_cs.c | |||
@@ -258,9 +258,7 @@ static void airo_detach(dev_link_t *link) | |||
258 | 258 | ||
259 | /* Unlink device structure, free pieces */ | 259 | /* Unlink device structure, free pieces */ |
260 | *linkp = link->next; | 260 | *linkp = link->next; |
261 | if (link->priv) { | 261 | kfree(link->priv); |
262 | kfree(link->priv); | ||
263 | } | ||
264 | kfree(link); | 262 | kfree(link); |
265 | 263 | ||
266 | } /* airo_detach */ | 264 | } /* airo_detach */ |
diff --git a/drivers/net/wireless/atmel.c b/drivers/net/wireless/atmel.c index d57011028b72..1fbe027d26b6 100644 --- a/drivers/net/wireless/atmel.c +++ b/drivers/net/wireless/atmel.c | |||
@@ -1653,8 +1653,7 @@ void stop_atmel_card(struct net_device *dev, int freeres) | |||
1653 | unregister_netdev(dev); | 1653 | unregister_netdev(dev); |
1654 | remove_proc_entry("driver/atmel", NULL); | 1654 | remove_proc_entry("driver/atmel", NULL); |
1655 | free_irq(dev->irq, dev); | 1655 | free_irq(dev->irq, dev); |
1656 | if (priv->firmware) | 1656 | kfree(priv->firmware); |
1657 | kfree(priv->firmware); | ||
1658 | if (freeres) { | 1657 | if (freeres) { |
1659 | /* PCMCIA frees this stuff, so only for PCI */ | 1658 | /* PCMCIA frees this stuff, so only for PCI */ |
1660 | release_region(dev->base_addr, 64); | 1659 | release_region(dev->base_addr, 64); |
@@ -2450,8 +2449,7 @@ static int atmel_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) | |||
2450 | break; | 2449 | break; |
2451 | } | 2450 | } |
2452 | 2451 | ||
2453 | if (priv->firmware) | 2452 | kfree(priv->firmware); |
2454 | kfree(priv->firmware); | ||
2455 | 2453 | ||
2456 | priv->firmware = new_firmware; | 2454 | priv->firmware = new_firmware; |
2457 | priv->firmware_length = com.len; | 2455 | priv->firmware_length = com.len; |
diff --git a/drivers/net/wireless/atmel_cs.c b/drivers/net/wireless/atmel_cs.c index ff031a3985b3..195cb36619e8 100644 --- a/drivers/net/wireless/atmel_cs.c +++ b/drivers/net/wireless/atmel_cs.c | |||
@@ -259,8 +259,7 @@ static void atmel_detach(dev_link_t *link) | |||
259 | 259 | ||
260 | /* Unlink device structure, free pieces */ | 260 | /* Unlink device structure, free pieces */ |
261 | *linkp = link->next; | 261 | *linkp = link->next; |
262 | if (link->priv) | 262 | kfree(link->priv); |
263 | kfree(link->priv); | ||
264 | kfree(link); | 263 | kfree(link); |
265 | } | 264 | } |
266 | 265 | ||
diff --git a/drivers/net/wireless/hermes.c b/drivers/net/wireless/hermes.c index eba0d9d2b7c5..579480dad374 100644 --- a/drivers/net/wireless/hermes.c +++ b/drivers/net/wireless/hermes.c | |||
@@ -444,6 +444,43 @@ int hermes_bap_pwrite(hermes_t *hw, int bap, const void *buf, unsigned len, | |||
444 | return err; | 444 | return err; |
445 | } | 445 | } |
446 | 446 | ||
447 | /* Write a block of data to the chip's buffer with padding if | ||
448 | * neccessary, via the BAP. Synchronization/serialization is the | ||
449 | * caller's problem. len must be even. | ||
450 | * | ||
451 | * Returns: < 0 on internal failure (errno), 0 on success, > 0 on error from firmware | ||
452 | */ | ||
453 | int hermes_bap_pwrite_pad(hermes_t *hw, int bap, const void *buf, unsigned data_len, unsigned len, | ||
454 | u16 id, u16 offset) | ||
455 | { | ||
456 | int dreg = bap ? HERMES_DATA1 : HERMES_DATA0; | ||
457 | int err = 0; | ||
458 | |||
459 | if (len < 0 || len % 2 || data_len > len) | ||
460 | return -EINVAL; | ||
461 | |||
462 | err = hermes_bap_seek(hw, bap, id, offset); | ||
463 | if (err) | ||
464 | goto out; | ||
465 | |||
466 | /* Transfer all the complete words of data */ | ||
467 | hermes_write_words(hw, dreg, buf, data_len/2); | ||
468 | /* If there is an odd byte left over pad and transfer it */ | ||
469 | if (data_len & 1) { | ||
470 | u8 end[2]; | ||
471 | end[1] = 0; | ||
472 | end[0] = ((unsigned char *)buf)[data_len - 1]; | ||
473 | hermes_write_words(hw, dreg, end, 1); | ||
474 | data_len ++; | ||
475 | } | ||
476 | /* Now send zeros for the padding */ | ||
477 | if (data_len < len) | ||
478 | hermes_clear_words(hw, dreg, (len - data_len) / 2); | ||
479 | /* Complete */ | ||
480 | out: | ||
481 | return err; | ||
482 | } | ||
483 | |||
447 | /* Read a Length-Type-Value record from the card. | 484 | /* Read a Length-Type-Value record from the card. |
448 | * | 485 | * |
449 | * If length is NULL, we ignore the length read from the card, and | 486 | * If length is NULL, we ignore the length read from the card, and |
@@ -531,6 +568,7 @@ EXPORT_SYMBOL(hermes_allocate); | |||
531 | 568 | ||
532 | EXPORT_SYMBOL(hermes_bap_pread); | 569 | EXPORT_SYMBOL(hermes_bap_pread); |
533 | EXPORT_SYMBOL(hermes_bap_pwrite); | 570 | EXPORT_SYMBOL(hermes_bap_pwrite); |
571 | EXPORT_SYMBOL(hermes_bap_pwrite_pad); | ||
534 | EXPORT_SYMBOL(hermes_read_ltv); | 572 | EXPORT_SYMBOL(hermes_read_ltv); |
535 | EXPORT_SYMBOL(hermes_write_ltv); | 573 | EXPORT_SYMBOL(hermes_write_ltv); |
536 | 574 | ||
diff --git a/drivers/net/wireless/hermes.h b/drivers/net/wireless/hermes.h index ad28e3294360..a6bd472d75d4 100644 --- a/drivers/net/wireless/hermes.h +++ b/drivers/net/wireless/hermes.h | |||
@@ -376,6 +376,8 @@ int hermes_bap_pread(hermes_t *hw, int bap, void *buf, unsigned len, | |||
376 | u16 id, u16 offset); | 376 | u16 id, u16 offset); |
377 | int hermes_bap_pwrite(hermes_t *hw, int bap, const void *buf, unsigned len, | 377 | int hermes_bap_pwrite(hermes_t *hw, int bap, const void *buf, unsigned len, |
378 | u16 id, u16 offset); | 378 | u16 id, u16 offset); |
379 | int hermes_bap_pwrite_pad(hermes_t *hw, int bap, const void *buf, | ||
380 | unsigned data_len, unsigned len, u16 id, u16 offset); | ||
379 | int hermes_read_ltv(hermes_t *hw, int bap, u16 rid, unsigned buflen, | 381 | int hermes_read_ltv(hermes_t *hw, int bap, u16 rid, unsigned buflen, |
380 | u16 *length, void *buf); | 382 | u16 *length, void *buf); |
381 | int hermes_write_ltv(hermes_t *hw, int bap, u16 rid, | 383 | int hermes_write_ltv(hermes_t *hw, int bap, u16 rid, |
diff --git a/drivers/net/wireless/hostap/hostap_ioctl.c b/drivers/net/wireless/hostap/hostap_ioctl.c index 53f5246c40aa..2617d70bcda9 100644 --- a/drivers/net/wireless/hostap/hostap_ioctl.c +++ b/drivers/net/wireless/hostap/hostap_ioctl.c | |||
@@ -552,7 +552,6 @@ static int prism2_ioctl_giwaplist(struct net_device *dev, | |||
552 | 552 | ||
553 | kfree(addr); | 553 | kfree(addr); |
554 | kfree(qual); | 554 | kfree(qual); |
555 | |||
556 | return 0; | 555 | return 0; |
557 | } | 556 | } |
558 | 557 | ||
@@ -3081,9 +3080,7 @@ static int prism2_ioctl_priv_download(local_info_t *local, struct iw_point *p) | |||
3081 | ret = local->func->download(local, param); | 3080 | ret = local->func->download(local, param); |
3082 | 3081 | ||
3083 | out: | 3082 | out: |
3084 | if (param != NULL) | 3083 | kfree(param); |
3085 | kfree(param); | ||
3086 | |||
3087 | return ret; | 3084 | return ret; |
3088 | } | 3085 | } |
3089 | #endif /* PRISM2_DOWNLOAD_SUPPORT */ | 3086 | #endif /* PRISM2_DOWNLOAD_SUPPORT */ |
@@ -3890,9 +3887,7 @@ static int prism2_ioctl_priv_hostapd(local_info_t *local, struct iw_point *p) | |||
3890 | } | 3887 | } |
3891 | 3888 | ||
3892 | out: | 3889 | out: |
3893 | if (param != NULL) | 3890 | kfree(param); |
3894 | kfree(param); | ||
3895 | |||
3896 | return ret; | 3891 | return ret; |
3897 | } | 3892 | } |
3898 | 3893 | ||
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c index de4e6c23e4b8..3db0c32afe82 100644 --- a/drivers/net/wireless/ipw2200.c +++ b/drivers/net/wireless/ipw2200.c | |||
@@ -4030,6 +4030,10 @@ static struct ipw_rx_queue *ipw_rx_queue_alloc(struct ipw_priv *priv) | |||
4030 | int i; | 4030 | int i; |
4031 | 4031 | ||
4032 | rxq = (struct ipw_rx_queue *)kmalloc(sizeof(*rxq), GFP_KERNEL); | 4032 | rxq = (struct ipw_rx_queue *)kmalloc(sizeof(*rxq), GFP_KERNEL); |
4033 | if (unlikely(!rxq)) { | ||
4034 | IPW_ERROR("memory allocation failed\n"); | ||
4035 | return NULL; | ||
4036 | } | ||
4033 | memset(rxq, 0, sizeof(*rxq)); | 4037 | memset(rxq, 0, sizeof(*rxq)); |
4034 | spin_lock_init(&rxq->lock); | 4038 | spin_lock_init(&rxq->lock); |
4035 | INIT_LIST_HEAD(&rxq->rx_free); | 4039 | INIT_LIST_HEAD(&rxq->rx_free); |
diff --git a/drivers/net/wireless/orinoco.c b/drivers/net/wireless/orinoco.c index d3d4ec9e242e..488ab06fb79f 100644 --- a/drivers/net/wireless/orinoco.c +++ b/drivers/net/wireless/orinoco.c | |||
@@ -490,7 +490,8 @@ static int orinoco_xmit(struct sk_buff *skb, struct net_device *dev) | |||
490 | return 0; | 490 | return 0; |
491 | } | 491 | } |
492 | 492 | ||
493 | /* Check packet length, pad short packets, round up odd length */ | 493 | /* Length of the packet body */ |
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, ALIGN(skb->len, 2), ETH_ZLEN); |
495 | skb = skb_padto(skb, len); | 496 | skb = skb_padto(skb, len); |
496 | if (skb == NULL) | 497 | if (skb == NULL) |
@@ -541,13 +542,21 @@ static int orinoco_xmit(struct sk_buff *skb, struct net_device *dev) | |||
541 | stats->tx_errors++; | 542 | stats->tx_errors++; |
542 | goto fail; | 543 | goto fail; |
543 | } | 544 | } |
545 | /* Actual xfer length - allow for padding */ | ||
546 | len = ALIGN(data_len, 2); | ||
547 | if (len < ETH_ZLEN - ETH_HLEN) | ||
548 | len = ETH_ZLEN - ETH_HLEN; | ||
544 | } else { /* IEEE 802.3 frame */ | 549 | } else { /* IEEE 802.3 frame */ |
545 | data_len = len + ETH_HLEN; | 550 | data_len = len + ETH_HLEN; |
546 | data_off = HERMES_802_3_OFFSET; | 551 | data_off = HERMES_802_3_OFFSET; |
547 | p = skb->data; | 552 | p = skb->data; |
553 | /* Actual xfer length - round up for odd length packets */ | ||
554 | len = ALIGN(data_len, 2); | ||
555 | if (len < ETH_ZLEN) | ||
556 | len = ETH_ZLEN; | ||
548 | } | 557 | } |
549 | 558 | ||
550 | err = hermes_bap_pwrite(hw, USER_BAP, p, data_len, | 559 | err = hermes_bap_pwrite_pad(hw, USER_BAP, p, data_len, len, |
551 | txfid, data_off); | 560 | txfid, data_off); |
552 | if (err) { | 561 | if (err) { |
553 | printk(KERN_ERR "%s: Error %d writing packet to BAP\n", | 562 | printk(KERN_ERR "%s: Error %d writing packet to BAP\n", |
diff --git a/drivers/net/wireless/prism54/islpci_dev.c b/drivers/net/wireless/prism54/islpci_dev.c index 6c9584a9f284..78bdb359835e 100644 --- a/drivers/net/wireless/prism54/islpci_dev.c +++ b/drivers/net/wireless/prism54/islpci_dev.c | |||
@@ -754,8 +754,7 @@ islpci_free_memory(islpci_private *priv) | |||
754 | pci_unmap_single(priv->pdev, buf->pci_addr, | 754 | pci_unmap_single(priv->pdev, buf->pci_addr, |
755 | buf->size, PCI_DMA_FROMDEVICE); | 755 | buf->size, PCI_DMA_FROMDEVICE); |
756 | buf->pci_addr = 0; | 756 | buf->pci_addr = 0; |
757 | if (buf->mem) | 757 | kfree(buf->mem); |
758 | kfree(buf->mem); | ||
759 | buf->size = 0; | 758 | buf->size = 0; |
760 | buf->mem = NULL; | 759 | buf->mem = NULL; |
761 | } | 760 | } |
diff --git a/drivers/net/wireless/prism54/islpci_eth.c b/drivers/net/wireless/prism54/islpci_eth.c index 5952e9960499..3b49efa37ee5 100644 --- a/drivers/net/wireless/prism54/islpci_eth.c +++ b/drivers/net/wireless/prism54/islpci_eth.c | |||
@@ -97,12 +97,6 @@ islpci_eth_transmit(struct sk_buff *skb, struct net_device *ndev) | |||
97 | /* lock the driver code */ | 97 | /* lock the driver code */ |
98 | spin_lock_irqsave(&priv->slock, flags); | 98 | spin_lock_irqsave(&priv->slock, flags); |
99 | 99 | ||
100 | /* determine the amount of fragments needed to store the frame */ | ||
101 | |||
102 | frame_size = skb->len < ETH_ZLEN ? ETH_ZLEN : skb->len; | ||
103 | if (init_wds) | ||
104 | frame_size += 6; | ||
105 | |||
106 | /* check whether the destination queue has enough fragments for the frame */ | 100 | /* check whether the destination queue has enough fragments for the frame */ |
107 | curr_frag = le32_to_cpu(cb->driver_curr_frag[ISL38XX_CB_TX_DATA_LQ]); | 101 | curr_frag = le32_to_cpu(cb->driver_curr_frag[ISL38XX_CB_TX_DATA_LQ]); |
108 | if (unlikely(curr_frag - priv->free_data_tx >= ISL38XX_CB_TX_QSIZE)) { | 102 | if (unlikely(curr_frag - priv->free_data_tx >= ISL38XX_CB_TX_QSIZE)) { |
@@ -213,6 +207,7 @@ islpci_eth_transmit(struct sk_buff *skb, struct net_device *ndev) | |||
213 | /* store the skb address for future freeing */ | 207 | /* store the skb address for future freeing */ |
214 | priv->data_low_tx[index] = skb; | 208 | priv->data_low_tx[index] = skb; |
215 | /* set the proper fragment start address and size information */ | 209 | /* set the proper fragment start address and size information */ |
210 | frame_size = skb->len; | ||
216 | fragment->size = cpu_to_le16(frame_size); | 211 | fragment->size = cpu_to_le16(frame_size); |
217 | fragment->flags = cpu_to_le16(0); /* set to 1 if more fragments */ | 212 | fragment->flags = cpu_to_le16(0); /* set to 1 if more fragments */ |
218 | fragment->address = cpu_to_le32(pci_map_address); | 213 | fragment->address = cpu_to_le32(pci_map_address); |
@@ -246,12 +241,10 @@ islpci_eth_transmit(struct sk_buff *skb, struct net_device *ndev) | |||
246 | return 0; | 241 | return 0; |
247 | 242 | ||
248 | drop_free: | 243 | drop_free: |
249 | /* free the skbuf structure before aborting */ | ||
250 | dev_kfree_skb(skb); | ||
251 | skb = NULL; | ||
252 | |||
253 | priv->statistics.tx_dropped++; | 244 | priv->statistics.tx_dropped++; |
254 | spin_unlock_irqrestore(&priv->slock, flags); | 245 | spin_unlock_irqrestore(&priv->slock, flags); |
246 | dev_kfree_skb(skb); | ||
247 | skb = NULL; | ||
255 | return err; | 248 | return err; |
256 | } | 249 | } |
257 | 250 | ||
diff --git a/drivers/net/wireless/prism54/oid_mgt.c b/drivers/net/wireless/prism54/oid_mgt.c index 12123e24b113..eea2f04c8c6d 100644 --- a/drivers/net/wireless/prism54/oid_mgt.c +++ b/drivers/net/wireless/prism54/oid_mgt.c | |||
@@ -268,11 +268,10 @@ mgt_clean(islpci_private *priv) | |||
268 | 268 | ||
269 | if (!priv->mib) | 269 | if (!priv->mib) |
270 | return; | 270 | return; |
271 | for (i = 0; i < OID_NUM_LAST; i++) | 271 | for (i = 0; i < OID_NUM_LAST; i++) { |
272 | if (priv->mib[i]) { | 272 | kfree(priv->mib[i]); |
273 | kfree(priv->mib[i]); | 273 | priv->mib[i] = NULL; |
274 | priv->mib[i] = NULL; | 274 | } |
275 | } | ||
276 | kfree(priv->mib); | 275 | kfree(priv->mib); |
277 | priv->mib = NULL; | 276 | priv->mib = NULL; |
278 | } | 277 | } |
diff --git a/drivers/net/wireless/strip.c b/drivers/net/wireless/strip.c index 7bc7fc823128..d25264ba0c0e 100644 --- a/drivers/net/wireless/strip.c +++ b/drivers/net/wireless/strip.c | |||
@@ -860,12 +860,9 @@ static int allocate_buffers(struct strip *strip_info, int mtu) | |||
860 | strip_info->mtu = dev->mtu = mtu; | 860 | strip_info->mtu = dev->mtu = mtu; |
861 | return (1); | 861 | return (1); |
862 | } | 862 | } |
863 | if (r) | 863 | kfree(r); |
864 | kfree(r); | 864 | kfree(s); |
865 | if (s) | 865 | kfree(t); |
866 | kfree(s); | ||
867 | if (t) | ||
868 | kfree(t); | ||
869 | return (0); | 866 | return (0); |
870 | } | 867 | } |
871 | 868 | ||
@@ -922,13 +919,9 @@ static int strip_change_mtu(struct net_device *dev, int new_mtu) | |||
922 | printk(KERN_NOTICE "%s: strip MTU changed fom %d to %d.\n", | 919 | printk(KERN_NOTICE "%s: strip MTU changed fom %d to %d.\n", |
923 | strip_info->dev->name, old_mtu, strip_info->mtu); | 920 | strip_info->dev->name, old_mtu, strip_info->mtu); |
924 | 921 | ||
925 | if (orbuff) | 922 | kfree(orbuff); |
926 | kfree(orbuff); | 923 | kfree(osbuff); |
927 | if (osbuff) | 924 | kfree(otbuff); |
928 | kfree(osbuff); | ||
929 | if (otbuff) | ||
930 | kfree(otbuff); | ||
931 | |||
932 | return 0; | 925 | return 0; |
933 | } | 926 | } |
934 | 927 | ||
@@ -2498,18 +2491,13 @@ static int strip_close_low(struct net_device *dev) | |||
2498 | /* | 2491 | /* |
2499 | * Free all STRIP frame buffers. | 2492 | * Free all STRIP frame buffers. |
2500 | */ | 2493 | */ |
2501 | if (strip_info->rx_buff) { | 2494 | kfree(strip_info->rx_buff); |
2502 | kfree(strip_info->rx_buff); | 2495 | strip_info->rx_buff = NULL; |
2503 | strip_info->rx_buff = NULL; | 2496 | kfree(strip_info->sx_buff); |
2504 | } | 2497 | strip_info->sx_buff = NULL; |
2505 | if (strip_info->sx_buff) { | 2498 | kfree(strip_info->tx_buff); |
2506 | kfree(strip_info->sx_buff); | 2499 | strip_info->tx_buff = NULL; |
2507 | strip_info->sx_buff = NULL; | 2500 | |
2508 | } | ||
2509 | if (strip_info->tx_buff) { | ||
2510 | kfree(strip_info->tx_buff); | ||
2511 | strip_info->tx_buff = NULL; | ||
2512 | } | ||
2513 | del_timer(&strip_info->idle_timer); | 2501 | del_timer(&strip_info->idle_timer); |
2514 | return 0; | 2502 | return 0; |
2515 | } | 2503 | } |