summaryrefslogtreecommitdiffstats
path: root/drivers/net/cnic.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-01-04 20:57:25 +0100
committerDavid S. Miller <davem@davemloft.net>2011-01-04 20:57:25 +0100
commitdbbe68bb12b34f3e450da7a73c20e6fa1f85d63a (patch)
tree10f8363cbf5e428c0cb5614959e37b67a7e0cfa2 /drivers/net/cnic.c
parentnet: typos in comments in include/linux/igmp.h (diff)
parentipv4/route.c: respect prefsrc for local routes (diff)
downloadlinux-dbbe68bb12b34f3e450da7a73c20e6fa1f85d63a.tar.xz
linux-dbbe68bb12b34f3e450da7a73c20e6fa1f85d63a.zip
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Diffstat (limited to 'drivers/net/cnic.c')
-rw-r--r--drivers/net/cnic.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/net/cnic.c b/drivers/net/cnic.c
index 6dfa56440ac0..aa5016ad9e19 100644
--- a/drivers/net/cnic.c
+++ b/drivers/net/cnic.c
@@ -951,7 +951,7 @@ static int cnic_alloc_uio_rings(struct cnic_dev *dev, int pages)
&udev->l2_ring_map,
GFP_KERNEL | __GFP_COMP);
if (!udev->l2_ring)
- return -ENOMEM;
+ goto err_udev;
udev->l2_buf_size = (cp->l2_rx_ring_size + 1) * cp->l2_single_buf_size;
udev->l2_buf_size = PAGE_ALIGN(udev->l2_buf_size);
@@ -959,7 +959,7 @@ static int cnic_alloc_uio_rings(struct cnic_dev *dev, int pages)
&udev->l2_buf_map,
GFP_KERNEL | __GFP_COMP);
if (!udev->l2_buf)
- return -ENOMEM;
+ goto err_dma;
write_lock(&cnic_dev_lock);
list_add(&udev->list, &cnic_udev_list);
@@ -970,6 +970,12 @@ static int cnic_alloc_uio_rings(struct cnic_dev *dev, int pages)
cp->udev = udev;
return 0;
+ err_dma:
+ dma_free_coherent(&udev->pdev->dev, udev->l2_ring_size,
+ udev->l2_ring, udev->l2_ring_map);
+ err_udev:
+ kfree(udev);
+ return -ENOMEM;
}
static int cnic_init_uio(struct cnic_dev *dev)