]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: Fix uninintialized error return
authorColin Ian King <colin.king@canonical.com>
Mon, 29 Jun 2015 16:10:22 +0000 (17:10 +0100)
committerTakashi Iwai <tiwai@suse.de>
Mon, 29 Jun 2015 17:08:31 +0000 (19:08 +0200)
commit81e2d91d8091e408aace990f937eeb64784c495c
treeedb8d032ea6c474cbb78860bb3937f7b57244df2
parentd6fa4cedea1cd7995a3a56836aa2d60741cc695d
ALSA: Fix uninintialized error return

Static analysis with cppcheck found the following error:
  [sound/core/init.c:118]: (error) Uninitialized variable: err

..this was introduced by commit b9b1ede77245fab9e498002c0ad79770cb6757c9
("ALSA: info: Register proc entries recursively, too") where the call
to snd_info_card_register was removed and no longer setting the error
return in err.  When snd_info_create_card_entry fails to allocate a
an entry, the error path exits with garbage in err.  Fix is to return
-ENOMEM if entry fails to be allocated.

Fixes: b9b1ede772 ("ALSA: info: Register proc entries recursively, too")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/init.c