summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrussell <russell@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2005-04-15 07:34:13 +0000
committerrussell <russell@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2005-04-15 07:34:13 +0000
commit25dc018479c97c21e55c8cbf9eaceb832e947075 (patch)
tree19319986e588c81978b4d84e527294a0e83778a7
parent04458e18fbf6e4c6259428b2c04ded4c335ee7b4 (diff)
fix mem leak when unloading/loading modules
git-svn-id: http://svn.digium.com/svn/zaptel/branches/v1-0@626 5390a7c7-147a-4af0-8ec9-7488f05a26cb
-rwxr-xr-xwct4xxp.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/wct4xxp.c b/wct4xxp.c
index 05694ef..c1fe977 100755
--- a/wct4xxp.c
+++ b/wct4xxp.c
@@ -1662,6 +1662,7 @@ static int t4_hardware_stop(struct t4 *wc)
static void __devexit t4_remove_one(struct pci_dev *pdev)
{
struct t4 *wc = pci_get_drvdata(pdev);
+ int x;
if (wc) {
/* Stop hardware */
t4_hardware_stop(wc);
@@ -1701,6 +1702,11 @@ static void __devexit t4_remove_one(struct pci_dev *pdev)
#endif
cards[wc->num] = NULL;
pci_set_drvdata(pdev, NULL);
+ for (x=0;x<4;x++) {
+ if (wc->chans[x])
+ kfree(wc->chans[x]);
+ }
+ kfree(wc);
}
}