ALSA: aloop: Release cable upon open error path
authorTakashi Iwai <tiwai@suse.de>
Fri, 5 Jan 2018 15:09:47 +0000 (16:09 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Sat, 3 Mar 2018 15:50:55 +0000 (15:50 +0000)
commit0e405098eb4ff9034e42810bde1ff24c63417e39
tree829853325e4f95e2648b923c951b9cf4299386fb
parentbbd3b58030892e40a1d7d2b2fee52b2d1961eefe
ALSA: aloop: Release cable upon open error path

commit 9685347aa0a5c2869058ca6ab79fd8e93084a67f upstream.

The aloop runtime object and its assignment in the cable are left even
when opening a substream fails.  This doesn't mean any memory leak,
but it still keeps the invalid pointer that may be referred by the
another side of the cable spontaneously, which is a potential Oops
cause.

Clean up the cable assignment and the empty cable upon the error path
properly.

Fixes: 597603d615d2 ("ALSA: introduce the snd-aloop module for the PCM loopback")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
sound/drivers/aloop.c