]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: usb/endpoint, fix dangling pointer use
authorJiri Slaby <jslaby@suse.cz>
Mon, 21 Jun 2010 15:03:21 +0000 (17:03 +0200)
committerTakashi Iwai <tiwai@suse.de>
Mon, 21 Jun 2010 15:07:58 +0000 (17:07 +0200)
commita0dffc97d250cb7b96971b3bb2742191ef6c6ca9
tree9ac944574d3a98e106a11d362cb69293cacb0d48
parent1d610ed47e63d83bbd4194b715eab1da4a857e5c
ALSA: usb/endpoint, fix dangling pointer use

Stanse found that in snd_usb_parse_audio_endpoints, there is a
dangling pointer dereference. When snd_usb_parse_audio_format fails,
fp is freed, and continue invoked. On the next loop, there is
"fp && fp->altsetting == 1 && fp->channels == 1" test, but fp is set
from the last iteration (but is bogus) and thus ilegally dereferenced.

Set fp to NULL before "continue".

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Acked-by: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/usb/endpoint.c