diff options
author | Takashi Iwai <tiwai@suse.de> | 2013-01-15 11:43:09 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2013-01-15 11:49:38 -0500 |
commit | 8ae3124b8f0f3f97f928be22ccc816118d4b0ecb (patch) | |
tree | 8ea0c9ba8dea48a5cda27ccecb58aff474633358 /sound/pci | |
parent | 549e8292a1e7712d401cc8b8df88286cdfff9f08 (diff) |
ALSA: hda/ca0132 - Fix possible invalid DMA channel deallocation
... in the error path in dspxfr_image().
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r-- | sound/pci/hda/patch_ca0132.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sound/pci/hda/patch_ca0132.c b/sound/pci/hda/patch_ca0132.c index ee2b9c6600ff..cc6c8a590316 100644 --- a/sound/pci/hda/patch_ca0132.c +++ b/sound/pci/hda/patch_ca0132.c | |||
@@ -2167,7 +2167,7 @@ static const struct dsp_image_seg *get_next_seg_ptr( | |||
2167 | /* | 2167 | /* |
2168 | * CA0132 chip DSP transfer stuffs. For DSP download. | 2168 | * CA0132 chip DSP transfer stuffs. For DSP download. |
2169 | */ | 2169 | */ |
2170 | #define INVALID_DMA_CHANNEL (~0UL) | 2170 | #define INVALID_DMA_CHANNEL (~0U) |
2171 | 2171 | ||
2172 | /* | 2172 | /* |
2173 | * Program a list of address/data pairs via the ChipIO widget. | 2173 | * Program a list of address/data pairs via the ChipIO widget. |
@@ -2431,7 +2431,7 @@ static int dspxfr_image(struct hda_codec *codec, | |||
2431 | dma_engine->buf_size = (ovly ? DSP_DMA_WRITE_BUFLEN_OVLY : | 2431 | dma_engine->buf_size = (ovly ? DSP_DMA_WRITE_BUFLEN_OVLY : |
2432 | DSP_DMA_WRITE_BUFLEN_INIT) * 2; | 2432 | DSP_DMA_WRITE_BUFLEN_INIT) * 2; |
2433 | 2433 | ||
2434 | dma_chan = 0; | 2434 | dma_chan = ovly ? INVALID_DMA_CHANNEL : 0; |
2435 | 2435 | ||
2436 | status = codec_set_converter_format(codec, WIDGET_CHIP_CTRL, | 2436 | status = codec_set_converter_format(codec, WIDGET_CHIP_CTRL, |
2437 | hda_format, &response); | 2437 | hda_format, &response); |
@@ -2453,7 +2453,7 @@ static int dspxfr_image(struct hda_codec *codec, | |||
2453 | status = dspio_alloc_dma_chan(codec, &dma_chan); | 2453 | status = dspio_alloc_dma_chan(codec, &dma_chan); |
2454 | if (status < 0) { | 2454 | if (status < 0) { |
2455 | snd_printdd(KERN_ERR "alloc dmachan fail"); | 2455 | snd_printdd(KERN_ERR "alloc dmachan fail"); |
2456 | dma_chan = (unsigned int)INVALID_DMA_CHANNEL; | 2456 | dma_chan = INVALID_DMA_CHANNEL; |
2457 | goto exit; | 2457 | goto exit; |
2458 | } | 2458 | } |
2459 | } | 2459 | } |