diff options
author | Takashi Iwai <tiwai@suse.de> | 2015-04-22 23:29:10 +0300 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2015-04-24 18:31:06 +0300 |
commit | b591b6e9e99017137888e2e397f0ddd8adb77c5d (patch) | |
tree | 5ef26ea5c88a94d2f942f933ffe7bbaa7349e102 /sound/core/info.c | |
parent | b046d244e2290e3d114af2e91503ee3d08fc605a (diff) | |
download | linux-b591b6e9e99017137888e2e397f0ddd8adb77c5d.tar.xz |
ALSA: core: Don't ignore errors at creating proc files
So far we've ignored the errors at creating proc files in many places.
But they should be rather treated seriously.
Also, by assuring the error handling, we can get rid of superfluous
snd_info_free_entry() calls as they will be removed by the parent in
the caller side.
This patch fixes the missing error checks and reduces the superfluous
free calls.
Acked-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core/info.c')
-rw-r--r-- | sound/core/info.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/sound/core/info.c b/sound/core/info.c index 339f90a3aa29..4169062fabf5 100644 --- a/sound/core/info.c +++ b/sound/core/info.c @@ -482,10 +482,11 @@ int __init snd_info_init(void) if (!snd_seq_root) goto error; #endif - snd_info_version_init(); - snd_minor_info_init(); - snd_minor_info_oss_init(); - snd_card_info_init(); + if (snd_info_version_init() < 0 || + snd_minor_info_init() < 0 || + snd_minor_info_oss_init() < 0 || + snd_card_info_init() < 0) + goto error; return 0; error: @@ -847,11 +848,7 @@ static int __init snd_info_version_init(void) if (entry == NULL) return -ENOMEM; entry->c.text.read = snd_info_version_read; - if (snd_info_register(entry) < 0) { - snd_info_free_entry(entry); - return -ENOMEM; - } - return 0; + return snd_info_register(entry); /* freed in error path */ } #endif /* CONFIG_PROC_FS */ |