mirror of
				https://gitea.osmocom.org/cellular-infrastructure/osmo-mgw.git
				synced 2025-11-03 21:43:32 +00:00 
			
		
		
		
	sgsn: Cancel pending timer in sgsn_mm_ctx_free
Currently the timer is not stopped before the MM context is freed which can lead to failure if sgsn_mm_ctx_free is called while timer protected procedures are active. This patch add code to cancel the timer if necessary from within sgsn_mm_ctx_free. Ticket: OW#1322 Sponsored-by: On-Waves ehf
This commit is contained in:
		
				
					committed by
					
						
						Holger Hans Peter Freyther
					
				
			
			
				
	
			
			
			
						parent
						
							19e990d6a7
						
					
				
				
					commit
					ae20b4b31b
				
			@@ -180,6 +180,11 @@ void sgsn_mm_ctx_free(struct sgsn_mm_ctx *mm)
 | 
			
		||||
{
 | 
			
		||||
	struct sgsn_pdp_ctx *pdp, *pdp2;
 | 
			
		||||
 | 
			
		||||
	if (osmo_timer_pending(&mm->timer)) {
 | 
			
		||||
		LOGMMCTXP(LOGL_INFO, mm, "Cancelling MM timer %u\n", mm->T);
 | 
			
		||||
		osmo_timer_del(&mm->timer);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/* Unlink from global list of MM contexts */
 | 
			
		||||
	llist_del(&mm->list);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user