Skip to content

Commit c0e7205

Browse files
Dan Carpentertiwai
authored andcommitted
ALSA: firewire-digi00x: prevent potential use after free
This code was supposed to return an error code if init_stream() failed, but it instead freed dg00x->rx_stream and returned success. This potentially leads to a use after free. Fixes: 9a08067 ("ALSA: firewire-digi00x: support AMDTP domain") Signed-off-by: Dan Carpenter <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent 4b963ae commit c0e7205

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

sound/firewire/digi00x/digi00x-stream.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,10 @@ int snd_dg00x_stream_init_duplex(struct snd_dg00x *dg00x)
259259
return err;
260260

261261
err = init_stream(dg00x, &dg00x->tx_stream);
262-
if (err < 0)
262+
if (err < 0) {
263263
destroy_stream(dg00x, &dg00x->rx_stream);
264+
return err;
265+
}
264266

265267
err = amdtp_domain_init(&dg00x->domain);
266268
if (err < 0) {

0 commit comments

Comments
 (0)