summaryrefslogtreecommitdiffstats
path: root/sound/core/seq/seq.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2018-08-01 16:37:02 +0200
committerTakashi Iwai <tiwai@suse.de>2018-08-01 22:54:36 +0200
commit00976ad5271999ba06d24319fd1031b178aff832 (patch)
tree0c88e68218eafd09b3d2b85179ab13fb199f34b6 /sound/core/seq/seq.c
parentfc4bfd9a35f3d9cbf5ad6a20faedca71d1d9ed52 (diff)
downloadtalos-op-linux-00976ad5271999ba06d24319fd1031b178aff832.tar.gz
talos-op-linux-00976ad5271999ba06d24319fd1031b178aff832.zip
ALSA: seq: Fix leftovers at probe error path
The sequencer core module doesn't call some destructors in the error path of the init code, which may leave some resources. This patch mainly fix these leaks by calling the destructors appropriately at alsa_seq_init(). Also the patch brings a few cleanups along with it, namely: - Expand the old "if ((err = xxx) < 0)" coding style - Get rid of empty seq_queue_init() and its caller - Change snd_seq_info_done() to void Last but not least, a couple of functions lose __exit annotation since they are called also in alsa_seq_init(). No functional changes but minor code cleanups. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core/seq/seq.c')
-rw-r--r--sound/core/seq/seq.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/sound/core/seq/seq.c b/sound/core/seq/seq.c
index e685eccdc741..7de98d71f2aa 100644
--- a/sound/core/seq/seq.c
+++ b/sound/core/seq/seq.c
@@ -84,26 +84,32 @@ static int __init alsa_seq_init(void)
{
int err;
- if ((err = client_init_data()) < 0)
- goto error;
-
- /* init event queues */
- if ((err = snd_seq_queues_init()) < 0)
+ err = client_init_data();
+ if (err < 0)
goto error;
/* register sequencer device */
- if ((err = snd_sequencer_device_init()) < 0)
+ err = snd_sequencer_device_init();
+ if (err < 0)
goto error;
/* register proc interface */
- if ((err = snd_seq_info_init()) < 0)
- goto error;
+ err = snd_seq_info_init();
+ if (err < 0)
+ goto error_device;
/* register our internal client */
- if ((err = snd_seq_system_client_init()) < 0)
- goto error;
+ err = snd_seq_system_client_init();
+ if (err < 0)
+ goto error_info;
snd_seq_autoload_init();
+ return 0;
+
+ error_info:
+ snd_seq_info_done();
+ error_device:
+ snd_sequencer_device_done();
error:
return err;
}
OpenPOWER on IntegriCloud