]> git.baikalelectronics.ru Git - kernel.git/commitdiff
ALSA: dice: fix error path to destroy initialized stream data
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Thu, 26 Apr 2018 13:00:29 +0000 (22:00 +0900)
committerTakashi Iwai <tiwai@suse.de>
Thu, 26 Apr 2018 13:24:54 +0000 (15:24 +0200)
In error path of snd_dice_stream_init_duplex(), stream data for incoming
packet can be left to be initialized.

This commit fixes it.

Fixes: d9548e9d408e ('ALSA: dice: handle whole available isochronous streams')
Cc: <stable@vger.kernel.org> # v4.6+
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/firewire/dice/dice-stream.c

index 8573289c381ed7314c6e1a08d4b39191756941f9..928a255bfc351406058b1c2bd8a43d785f63ef97 100644 (file)
@@ -435,7 +435,7 @@ int snd_dice_stream_init_duplex(struct snd_dice *dice)
                err = init_stream(dice, AMDTP_IN_STREAM, i);
                if (err < 0) {
                        for (; i >= 0; i--)
-                               destroy_stream(dice, AMDTP_OUT_STREAM, i);
+                               destroy_stream(dice, AMDTP_IN_STREAM, i);
                        goto end;
                }
        }