[zaptel-commits] trunk r1225 - /trunk/xpp/

zaptel-commits at lists.digium.com zaptel-commits at lists.digium.com
Fri Jul 14 12:17:45 MST 2006


Author: tzafrir
Date: Fri Jul 14 14:17:45 2006
New Revision: 1225

URL: http://svn.digium.com/view/zaptel?rev=1225&view=rev
Log:
NULLify pointers to /proc files after removing them (so anyone who tries to 
access them afterwards causes iimmediate Oops instead of unknown behaviour).

Modified:
    trunk/xpp/card_fxo.c
    trunk/xpp/card_fxs.c
    trunk/xpp/xbus-core.c
    trunk/xpp/xpp_usb.c
    trunk/xpp/xpp_zap.c

Modified: trunk/xpp/card_fxo.c
URL: http://svn.digium.com/view/zaptel/trunk/xpp/card_fxo.c?rev=1225&r1=1224&r2=1225&view=diff
==============================================================================
--- trunk/xpp/card_fxo.c (original)
+++ trunk/xpp/card_fxo.c Fri Jul 14 14:17:45 2006
@@ -211,10 +211,12 @@
 	if(priv->xpd_slic) {
 		DBG("Removing xpd DAA file %s/%s\n", xbus->busname, xpd->xpdname);
 		remove_proc_entry(PROC_DAA_FNAME, xpd->proc_xpd_dir);
+		priv->xpd_slic = NULL;
 	}
 	if(priv->fxo_info) {
 		DBG("Removing xpd FXO_INFO file %s/%s\n", xbus->busname, xpd->xpdname);
 		remove_proc_entry(PROC_FXO_INFO_FNAME, xpd->proc_xpd_dir);
+		priv->fxo_info = NULL;
 	}
 #endif
 }

Modified: trunk/xpp/card_fxs.c
URL: http://svn.digium.com/view/zaptel/trunk/xpp/card_fxs.c?rev=1225&r1=1224&r2=1225&view=diff
==============================================================================
--- trunk/xpp/card_fxs.c (original)
+++ trunk/xpp/card_fxs.c Fri Jul 14 14:17:45 2006
@@ -282,10 +282,12 @@
 		DBG("Removing xpd SLIC file %s/%s\n", xbus->busname, xpd->xpdname);
 		priv->xpd_slic->data = NULL;
 		remove_proc_entry(PROC_SLIC_FNAME, xpd->proc_xpd_dir);
+		priv->xpd_slic = NULL;
 	}
 	if(priv->fxs_info) {
 		DBG("Removing xpd FXS_INFO file %s/%s\n", xbus->busname, xpd->xpdname);
 		remove_proc_entry(PROC_FXS_INFO_FNAME, xpd->proc_xpd_dir);
+		priv->fxs_info = NULL;
 	}
 #endif
 }

Modified: trunk/xpp/xbus-core.c
URL: http://svn.digium.com/view/zaptel/trunk/xpp/xbus-core.c?rev=1225&r1=1224&r2=1225&view=diff
==============================================================================
--- trunk/xpp/xbus-core.c (original)
+++ trunk/xpp/xbus-core.c Fri Jul 14 14:17:45 2006
@@ -809,8 +809,10 @@
 		xpp_worker = NULL;
 	}
 #ifdef CONFIG_PROC_FS
-	if(proc_xbuses)
+	if(proc_xbuses) {
 		remove_proc_entry(PROC_XBUSES, xpp_proc_toplevel);
+		proc_xbuses = NULL;
+	}
 #endif
 	if(packet_cache)
 		kmem_cache_destroy(packet_cache);

Modified: trunk/xpp/xpp_usb.c
URL: http://svn.digium.com/view/zaptel/trunk/xpp/xpp_usb.c?rev=1225&r1=1224&r2=1225&view=diff
==============================================================================
--- trunk/xpp/xpp_usb.c (original)
+++ trunk/xpp/xpp_usb.c Fri Jul 14 14:17:45 2006
@@ -662,6 +662,7 @@
 		if(procsummary) {
 			DBG("Remove proc_entry: " PROC_USBXPP_SUMMARY "\n");
 			remove_proc_entry(PROC_USBXPP_SUMMARY, xbus->proc_xbus_dir);
+			procsummary = NULL;
 		}
 		xbus_disconnect(xbus);		// Blocking until fully deactivated!
 	}
@@ -705,6 +706,7 @@
 #ifdef CONFIG_PROC_FS
 	if(xbus->proc_xbus_dir) {
 		remove_proc_entry(PROC_USBXPP_SUMMARY, xbus->proc_xbus_dir);
+		xbus->proc_xbus_dir = NULL;
 	}
 #endif
 	xusb->present = 0;

Modified: trunk/xpp/xpp_zap.c
URL: http://svn.digium.com/view/zaptel/trunk/xpp/xpp_zap.c?rev=1225&r1=1224&r2=1225&view=diff
==============================================================================
--- trunk/xpp/xpp_zap.c (original)
+++ trunk/xpp/xpp_zap.c Fri Jul 14 14:17:45 2006
@@ -1491,6 +1491,7 @@
 	remove_proc_entry(PROC_SYNC, xpp_proc_toplevel);
 	if(xpp_proc_toplevel) {
 		remove_proc_entry(PROC_DIR, NULL);
+		xpp_proc_toplevel = NULL;
 	}
 #endif
 }



More information about the zaptel-commits mailing list