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>
This commit is contained in:
Takashi Iwai
2015-04-22 22:29:10 +02:00
والد b046d244e2
کامیت b591b6e9e9
5فایلهای تغییر یافته به همراه35 افزوده شده و 35 حذف شده

مشاهده پرونده

@@ -386,14 +386,10 @@ int __init snd_minor_info_init(void)
struct snd_info_entry *entry;
entry = snd_info_create_module_entry(THIS_MODULE, "devices", NULL);
if (entry) {
entry->c.text.read = snd_minor_info_read;
if (snd_info_register(entry) < 0) {
snd_info_free_entry(entry);
entry = NULL;
}
}
return 0;
if (!entry)
return -ENOMEM;
entry->c.text.read = snd_minor_info_read;
return snd_info_register(entry); /* freed in error path */
}
#endif /* CONFIG_PROC_FS */