diff options
author | markster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2005-04-13 03:52:17 +0000 |
---|---|---|
committer | markster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2005-04-13 03:52:17 +0000 |
commit | 1cf4ed7ff182c042fd7f4207933ce4888daadd6a (patch) | |
tree | f53ab5c63111b4d6eec90b9387e9381ceeb6b7d2 /wct4xxp.c | |
parent | 374635a09589593782c5f757ab1727efe8d1bcc9 (diff) |
Fix memory leak on loading/unloading module
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@624 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'wct4xxp.c')
-rwxr-xr-x | wct4xxp.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -1670,6 +1670,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); @@ -1709,6 +1710,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); } } |