diff options
author | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2016-03-31 02:47:02 +0300 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2016-03-31 16:36:17 +0300 |
commit | 44c376b9596ca00d1bdee37e716d1bd4dd36c955 (patch) | |
tree | c4924408e819b03f2faa43cd05938c369da8f169 /sound/firewire/amdtp-stream.c | |
parent | 97cc2ed27e5a168cf423f67c3bc7c6cc41d12f82 (diff) | |
download | linux-44c376b9596ca00d1bdee37e716d1bd4dd36c955.tar.xz |
ALSA: firewire-lib: suppress kernel warnings when releasing uninitialized stream data
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 when it's not initialized.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire/amdtp-stream.c')
-rw-r--r-- | sound/firewire/amdtp-stream.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sound/firewire/amdtp-stream.c b/sound/firewire/amdtp-stream.c index ed2902609a4c..4484242da0e6 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); |