@@ -342,6 +342,9 @@ static int loopback_prepare(struct snd_pcm_substream *substream)
struct loopback_cable *cable = dpcm->cable;
int bps, salign;
+ /* make sure that timer gets deleted */
+ del_timer_sync(&dpcm->timer);
+
salign = (snd_pcm_format_width(runtime->format) *
runtime->channels) / 8;
bps = salign * runtime->rate;
@@ -736,6 +739,8 @@ static int loopback_close(struct snd_pcm_substream *substream)
int dev = get_cable_index(substream);
loopback_timer_stop(dpcm);
+ del_timer_sync(&dpcm->timer);
+
mutex_lock(&loopback->cable_lock);
cable = loopback->cables[substream->number][dev];
if (cable->streams[!substream->stream]) {