aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/airo.c
diff options
context:
space:
mode:
authorJesper Juhl <jesper.juhl@gmail.com>2005-10-28 16:53:13 -0400
committerJeff Garzik <jgarzik@pobox.com>2005-10-28 16:53:13 -0400
commitb4558ea93d66a43f7990d26f145fd4c54a01c9bf (patch)
tree70aa8ba4864f8ee994b7f5278f5045af6a646d34 /drivers/net/wireless/airo.c
parent7380a78a973a8109c13cb0e47617c456b6f6e1f5 (diff)
drivers/net: Remove pointless checks for NULL prior to calling kfree()
Diffstat (limited to 'drivers/net/wireless/airo.c')
-rw-r--r--drivers/net/wireless/airo.c48
1 files changed, 19 insertions, 29 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
5370static int proc_close( struct inode *inode, struct file *file ) 5358static 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