murphyif: Free the connect timer when unloading 60/28360/1
authorTanu Kaskinen <tanu.kaskinen@linux.intel.com>
Fri, 3 Oct 2014 13:54:49 +0000 (16:54 +0300)
committerTanu Kaskinen <tanu.kaskinen@linux.intel.com>
Fri, 3 Oct 2014 13:59:58 +0000 (16:59 +0300)
This fixes a crash when unloading module-murphy-ivi. Triggering the
crash probably requires that Murphy isn't running (I haven't tried
with Murphy running). The crash occurs after the module has unloaded,
and the connect timer fires - at that point the timer callback
function has been removed from the memory, so the timer callback
pointer points to invalid memory, causing a segfault when calling the
callback.

Change-Id: I78290f172eff70716491000ef9d4f37822bf3faa

murphy/murphyif.c

index ce24ba8..fab0970 100644 (file)
@@ -398,6 +398,8 @@ void pa_murphyif_done(struct userdata *u)
         PA_LLIST_FOREACH_SAFE(req, r, rif->reqs)
             pa_xfree(req);
 
+        cancel_schedule(u, rif);
+
         pa_xfree((void *)rif->addr);
         pa_xfree((void *)rif->inpres.name);
         pa_xfree((void *)rif->outres.name);