From 0c3cbc2c32b7b53b1c99855ab018360352ae8750 Mon Sep 17 00:00:00 2001 From: Shaun Ruffell Date: Wed, 15 Dec 2010 17:53:16 +0000 Subject: [PATCH] wcte12xp: Unregister the span before any additional cleanup. Span registration is the last step in during initialization and it should be the first on unregistration. I also was hit by this when looking at adding other members to the span and made the assumption that the span was in a consistent state during unregistration. Signed-off-by: Shaun Ruffell Acked-by: Kinsey Moore Acked-By: Russ Meyerriecks git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9536 a0bf4364-ded3-4de4-8d8a-66a801d63aff --- drivers/dahdi/wcte12xp/base.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/dahdi/wcte12xp/base.c b/drivers/dahdi/wcte12xp/base.c index 99267be..5f559dc 100644 --- a/drivers/dahdi/wcte12xp/base.c +++ b/drivers/dahdi/wcte12xp/base.c @@ -727,13 +727,6 @@ static void free_wc(struct t1 *wc) kfree(wc); } -static void t1_release(struct t1 *wc) -{ - dahdi_unregister(&wc->span); - t1_info(wc, "Freed a Wildcard TE12xP.\n"); - free_wc(wc); -} - static void t4_serial_setup(struct t1 *wc) { t1_info(wc, "Setting up global serial parameters for %s\n", @@ -2358,6 +2351,8 @@ static void __devexit te12xp_remove_one(struct pci_dev *pdev) if (!wc) return; + dahdi_unregister(&wc->span); + remove_sysfs_files(wc); clear_bit(INITIALIZED, &wc->bit_flags); @@ -2381,7 +2376,8 @@ static void __devexit te12xp_remove_one(struct pci_dev *pdev) } #endif - t1_release(wc); + t1_info(wc, "Freed a Wildcard TE12xP.\n"); + free_wc(wc); } static struct pci_device_id te12xp_pci_tbl[] = {