Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 22799
b: refs/heads/master
c: bb160b8
h: refs/heads/master
i:
  22797: 476a214
  22795: 683ce5a
  22791: 24cc651
  22783: ff4af8d
v: v3
  • Loading branch information
Sergei Shtylyov authored and Jaroslav Kysela committed Mar 22, 2006
1 parent 6093b5b commit f35014f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 97ec558a88fb03fa23aee0832a88964e76e4a4db
refs/heads/master: bb160b850d7e285f8b15906d9c0d1916acfdb953
33 changes: 20 additions & 13 deletions trunk/sound/mips/au1x00.c
Original file line number Diff line number Diff line change
Expand Up @@ -612,14 +612,17 @@ snd_au1000_free(struct snd_card *card)
release_and_free_resource(au1000->ac97_res_port);
}

if (au1000->stream[PLAYBACK]->dma >= 0)
free_au1000_dma(au1000->stream[PLAYBACK]->dma);

if (au1000->stream[CAPTURE]->dma >= 0)
free_au1000_dma(au1000->stream[CAPTURE]->dma);
if (au1000->stream[PLAYBACK]) {
if (au1000->stream[PLAYBACK]->dma >= 0)
free_au1000_dma(au1000->stream[PLAYBACK]->dma);
kfree(au1000->stream[PLAYBACK]);
}

kfree(au1000->stream[PLAYBACK]);
kfree(au1000->stream[CAPTURE]);
if (au1000->stream[CAPTURE]) {
if (au1000->stream[CAPTURE]->dma >= 0)
free_au1000_dma(au1000->stream[CAPTURE]->dma);
kfree(au1000->stream[CAPTURE]);
}
}


Expand All @@ -638,15 +641,19 @@ au1000_init(void)

card->private_free = snd_au1000_free;
au1000 = card->private_data;
/* so that snd_au1000_free will work as intended */
au1000->card = card;
au1000->stream[PLAYBACK]->dma = -1;
au1000->stream[CAPTURE]->dma = -1;
au1000->ac97_res_port = NULL;

au1000->stream[PLAYBACK] = kmalloc(sizeof(struct audio_stream), GFP_KERNEL);
au1000->stream[CAPTURE] = kmalloc(sizeof(struct audio_stream), GFP_KERNEL);
au1000->stream[CAPTURE ] = kmalloc(sizeof(struct audio_stream), GFP_KERNEL);
/* so that snd_au1000_free will work as intended */
au1000->ac97_res_port = NULL;
if (au1000->stream[PLAYBACK])
au1000->stream[PLAYBACK]->dma = -1;
if (au1000->stream[CAPTURE ])
au1000->stream[CAPTURE ]->dma = -1;

if (au1000->stream[PLAYBACK] == NULL ||
au1000->stream[CAPTURE] == NULL) {
au1000->stream[CAPTURE ] == NULL) {
snd_card_free(card);
return -ENOMEM;
}
Expand Down

0 comments on commit f35014f

Please sign in to comment.