]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/tokenring/3c359.c
Merge branch 'linux-next' of git://git.infradead.org/ubifs-2.6
[linux-2.6-omap-h63xx.git] / drivers / net / tokenring / 3c359.c
index 87509a65b3bfa6fd8ab8fd8d071a842637181195..43853e3b210e42977100f1c1b3828a3dfa9fe623 100644 (file)
@@ -296,8 +296,9 @@ static int __devinit xl_probe(struct pci_dev *pdev,
        } ; 
 
        /* 
-        * Allowing init_trdev to allocate the dev->priv structure will align xl_private
-        * on a 32 bytes boundary which we need for the rx/tx descriptors
+        * Allowing init_trdev to allocate the private data will align
+        * xl_private on a 32 bytes boundary which we need for the rx/tx
+        * descriptors
         */
 
        dev = alloc_trdev(sizeof(struct xl_private)) ; 
@@ -638,13 +639,13 @@ static int xl_open(struct net_device *dev)
        /* These MUST be on 8 byte boundaries */
        xl_priv->xl_tx_ring = kzalloc((sizeof(struct xl_tx_desc) * XL_TX_RING_SIZE) + 7, GFP_DMA | GFP_KERNEL);
        if (xl_priv->xl_tx_ring == NULL) {
-               printk(KERN_WARNING "%s: Not enough memory to allocate rx buffers.\n",
+               printk(KERN_WARNING "%s: Not enough memory to allocate tx buffers.\n",
                                     dev->name);
                free_irq(dev->irq,dev);
                return -ENOMEM;
        }
        xl_priv->xl_rx_ring = kzalloc((sizeof(struct xl_rx_desc) * XL_RX_RING_SIZE) +7, GFP_DMA | GFP_KERNEL);
-       if (xl_priv->xl_tx_ring == NULL) {
+       if (xl_priv->xl_rx_ring == NULL) {
                printk(KERN_WARNING "%s: Not enough memory to allocate rx buffers.\n",
                                     dev->name);
                free_irq(dev->irq,dev);
@@ -669,6 +670,8 @@ static int xl_open(struct net_device *dev)
        if (i==0) { 
                printk(KERN_WARNING "%s: Not enough memory to allocate rx buffers. Adapter disabled \n",dev->name) ; 
                free_irq(dev->irq,dev) ; 
+               kfree(xl_priv->xl_tx_ring);
+               kfree(xl_priv->xl_rx_ring);
                return -EIO ; 
        }