From 168c3cf16d08b3773c8b33f2bbb4f63c77277884 Mon Sep 17 00:00:00 2001 From: Michael Chan Date: Wed, 13 Oct 2010 14:06:48 +0000 Subject: [PATCH] --- yaml --- r: 215158 b: refs/heads/master c: c06c0462250a5dbc9e58d00caab4cd7e6675128c h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/net/cnic.c | 37 +++++++++++++++++++++++++++---------- 2 files changed, 28 insertions(+), 11 deletions(-) diff --git a/[refs] b/[refs] index 18ec15ecd16f..fa402b5a244f 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: fdf24086f4752aee5dfb40143c736250df017820 +refs/heads/master: c06c0462250a5dbc9e58d00caab4cd7e6675128c diff --git a/trunk/drivers/net/cnic.c b/trunk/drivers/net/cnic.c index b12bba795f2e..739ffcb9bff0 100644 --- a/trunk/drivers/net/cnic.c +++ b/trunk/drivers/net/cnic.c @@ -770,20 +770,15 @@ static void cnic_free_context(struct cnic_dev *dev) } } -static void cnic_free_resc(struct cnic_dev *dev) +static void __cnic_free_uio(struct cnic_dev *dev) { struct cnic_local *cp = dev->cnic_priv; - int i = 0; - if (cp->cnic_uinfo) { - while (cp->uio_dev != -1 && i < 15) { - msleep(100); - i++; - } + if (cp->cnic_uinfo) uio_unregister_device(cp->cnic_uinfo); - kfree(cp->cnic_uinfo); - cp->cnic_uinfo = NULL; - } + + kfree(cp->cnic_uinfo); + cp->cnic_uinfo = NULL; if (cp->l2_buf) { dma_free_coherent(&dev->pcidev->dev, cp->l2_buf_size, @@ -796,6 +791,28 @@ static void cnic_free_resc(struct cnic_dev *dev) cp->l2_ring, cp->l2_ring_map); cp->l2_ring = NULL; } +} + +static void cnic_free_uio(struct cnic_dev *dev) +{ + if (!dev) + return; + + __cnic_free_uio(dev); +} + +static void cnic_free_resc(struct cnic_dev *dev) +{ + struct cnic_local *cp = dev->cnic_priv; + int i = 0; + + if (cp->cnic_uinfo) { + while (cp->uio_dev != -1 && i < 15) { + msleep(100); + i++; + } + cnic_free_uio(dev); + } cnic_free_context(dev); kfree(cp->ctx_arr);