OSDN Git Service
namehint: Fix invalid list access in snd_device_name_hint()
snd_device_name_hint() tries to free the allocated list at the error
path via snd_device_name_free_hint(). But snd_device_name_free_hint()
expects a list terminated by NULL while snd_device_name_hint() doesn't
add it. Adding it may again result in an error and thus isn't
guaranteed to work. Hence we can't add NULL at the error path.
Instead, now the code always allocates one entry more, and zero-clears
the newly allocated beforehand to guarantee the NULL termination.
Signed-off-by: Takashi Iwai <tiwai@suse.de>