[alsa-devel] [PATCH 2/2] ALSA: firewire-lib: skip releasing stream data when it's not initialized

Takashi Sakamoto o-takashi at sakamocchi.jp
Sat Mar 26 13:05:59 CET 2016


When any of AMDTP stream data are not initialized and private data is
going to be released, WARN_ON() in amdtp_stream_destroy() is hit and
dump messages. This may take users irritated.

This commit fixes the bug to skip releasing stream data when the data is
not initialized.

Signed-off-by: Takashi Sakamoto <o-takashi at sakamocchi.jp>
---
 sound/firewire/amdtp-stream.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sound/firewire/amdtp-stream.c b/sound/firewire/amdtp-stream.c
index ed29026..4484242 100644
--- a/sound/firewire/amdtp-stream.c
+++ b/sound/firewire/amdtp-stream.c
@@ -102,6 +102,10 @@ EXPORT_SYMBOL(amdtp_stream_init);
  */
 void amdtp_stream_destroy(struct amdtp_stream *s)
 {
+	/* Not initialized. */
+	if (s->protocol == NULL)
+		return;
+
 	WARN_ON(amdtp_stream_running(s));
 	kfree(s->protocol);
 	mutex_destroy(&s->mutex);
-- 
2.7.3



More information about the Alsa-devel mailing list