[PATCH] 2.5.24 - drivers/net/tlan.c dma mapping 9/10

From: Francois Romieu (romieu@cogenit.fr)
Date: Sun Jun 30 2002 - 10:20:00 EST


- (cosmetic) gotoize error paths in TLan_Init.

--- linux-2.5.24/drivers/net/tlan.c Sun Jun 30 14:54:32 2002
+++ linux-2.5.24/drivers/net/tlan.c Sun Jun 30 15:10:34 2002
@@ -805,11 +805,10 @@ static int TLan_Init( struct net_device
 
         if (!priv->is_eisa) /* EISA devices have already requested IO */
                 if (!request_region( dev->base_addr, 0x10, TLanSignature )) {
- printk(KERN_ERR "TLAN: %s: IO port region 0x%lx size 0x%x in use.\n",
- dev->name,
- dev->base_addr,
- 0x10 );
- return -EIO;
+ printk(KERN_ERR "%s: IO port region 0x%lx size 0x%x in use\n",
+ dev->name, dev->base_addr, 0x10);
+ err = -EIO;
+ goto err_out;
                 }
 
         dma_size = TLAN_TOTAL_SIZE;
@@ -817,8 +816,8 @@ static int TLan_Init( struct net_device
         if (!addr) {
                 printk(KERN_ERR "TLAN: Could not allocate lists and buffers for %s.\n",
                         dev->name );
- release_region( dev->base_addr, 0x10 );
- return -ENOMEM;
+ err = -ENOMEM;
+ goto err_out_release_region;
         }
         /*
          * pci_alloc_consistent and an adequate power of 2 for TLAN_NUM_RX_LISTS
@@ -833,10 +832,8 @@ static int TLan_Init( struct net_device
                 if ( addr == NULL ) {
                         printk(KERN_ERR "%s: buffers allocation failed\n",
                                 dev->name );
- pci_free_consistent(pdev, TLAN_TOTAL_SIZE, priv->rxList,
- priv->lists_dma);
- release_region( dev->base_addr, 0x10 );
- return -ENOMEM;
+ err = -ENOMEM;
+ goto err_out_free_consistent;
                 }
                 memset(addr, 0, dma_size );
                 priv->rxBuffer = (u8 *)addr;
@@ -874,6 +871,14 @@ static int TLan_Init( struct net_device
 
         return 0;
 
+err_out_free_consistent:
+ pci_free_consistent(pdev, TLAN_TOTAL_SIZE, priv->rxList,
+ priv->lists_dma);
+err_out_release_region:
+ release_region( dev->base_addr, 0x10 );
+err_out:
+ return err;
+
 } /* TLan_Init */
 
 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Jun 30 2002 - 22:00:15 EST