diff options
Diffstat (limited to 'sound/usb/stream.c')
-rw-r--r-- | sound/usb/stream.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sound/usb/stream.c b/sound/usb/stream.c index 51258a15f653..8e9548bc1f1a 100644 --- a/sound/usb/stream.c +++ b/sound/usb/stream.c | |||
@@ -36,7 +36,6 @@ | |||
36 | #include "format.h" | 36 | #include "format.h" |
37 | #include "clock.h" | 37 | #include "clock.h" |
38 | #include "stream.h" | 38 | #include "stream.h" |
39 | #include "media.h" | ||
40 | 39 | ||
41 | /* | 40 | /* |
42 | * free a substream | 41 | * free a substream |
@@ -53,7 +52,6 @@ static void free_substream(struct snd_usb_substream *subs) | |||
53 | kfree(fp); | 52 | kfree(fp); |
54 | } | 53 | } |
55 | kfree(subs->rate_list.list); | 54 | kfree(subs->rate_list.list); |
56 | media_snd_stream_delete(subs); | ||
57 | } | 55 | } |
58 | 56 | ||
59 | 57 | ||
@@ -316,7 +314,9 @@ static struct snd_pcm_chmap_elem *convert_chmap(int channels, unsigned int bits, | |||
316 | /* | 314 | /* |
317 | * add this endpoint to the chip instance. | 315 | * add this endpoint to the chip instance. |
318 | * if a stream with the same endpoint already exists, append to it. | 316 | * if a stream with the same endpoint already exists, append to it. |
319 | * if not, create a new pcm stream. | 317 | * if not, create a new pcm stream. note, fp is added to the substream |
318 | * fmt_list and will be freed on the chip instance release. do not free | ||
319 | * fp or do remove it from the substream fmt_list to avoid double-free. | ||
320 | */ | 320 | */ |
321 | int snd_usb_add_audio_stream(struct snd_usb_audio *chip, | 321 | int snd_usb_add_audio_stream(struct snd_usb_audio *chip, |
322 | int stream, | 322 | int stream, |
@@ -677,6 +677,7 @@ int snd_usb_parse_audio_interface(struct snd_usb_audio *chip, int iface_no) | |||
677 | * (fp->maxpacksize & 0x7ff); | 677 | * (fp->maxpacksize & 0x7ff); |
678 | fp->attributes = parse_uac_endpoint_attributes(chip, alts, protocol, iface_no); | 678 | fp->attributes = parse_uac_endpoint_attributes(chip, alts, protocol, iface_no); |
679 | fp->clock = clock; | 679 | fp->clock = clock; |
680 | INIT_LIST_HEAD(&fp->list); | ||
680 | 681 | ||
681 | /* some quirks for attributes here */ | 682 | /* some quirks for attributes here */ |
682 | 683 | ||
@@ -725,6 +726,7 @@ int snd_usb_parse_audio_interface(struct snd_usb_audio *chip, int iface_no) | |||
725 | dev_dbg(&dev->dev, "%u:%d: add audio endpoint %#x\n", iface_no, altno, fp->endpoint); | 726 | dev_dbg(&dev->dev, "%u:%d: add audio endpoint %#x\n", iface_no, altno, fp->endpoint); |
726 | err = snd_usb_add_audio_stream(chip, stream, fp); | 727 | err = snd_usb_add_audio_stream(chip, stream, fp); |
727 | if (err < 0) { | 728 | if (err < 0) { |
729 | list_del(&fp->list); /* unlink for avoiding double-free */ | ||
728 | kfree(fp->rate_table); | 730 | kfree(fp->rate_table); |
729 | kfree(fp->chmap); | 731 | kfree(fp->chmap); |
730 | kfree(fp); | 732 | kfree(fp); |