ALSA: hda/ca0132 - Fix possible invalid DMA channel deallocation
authorTakashi Iwai <tiwai@suse.de>
Tue, 15 Jan 2013 16:43:09 +0000 (17:43 +0100)
committerTakashi Iwai <tiwai@suse.de>
Tue, 15 Jan 2013 16:49:38 +0000 (17:49 +0100)
... in the error path in dspxfr_image().

Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/patch_ca0132.c

index ee2b9c6600ffc296beb86c1d87657d2bb857363c..cc6c8a5903160566cd372135d23d98e6c828c46d 100644 (file)
@@ -2167,7 +2167,7 @@ static const struct dsp_image_seg *get_next_seg_ptr(
 /*
  * CA0132 chip DSP transfer stuffs.  For DSP download.
  */
-#define INVALID_DMA_CHANNEL (~0UL)
+#define INVALID_DMA_CHANNEL (~0U)
 
 /*
  * Program a list of address/data pairs via the ChipIO widget.
@@ -2431,7 +2431,7 @@ static int dspxfr_image(struct hda_codec *codec,
        dma_engine->buf_size = (ovly ? DSP_DMA_WRITE_BUFLEN_OVLY :
                        DSP_DMA_WRITE_BUFLEN_INIT) * 2;
 
-       dma_chan = 0;
+       dma_chan = ovly ? INVALID_DMA_CHANNEL : 0;
 
        status = codec_set_converter_format(codec, WIDGET_CHIP_CTRL,
                                        hda_format, &response);
@@ -2453,7 +2453,7 @@ static int dspxfr_image(struct hda_codec *codec,
                status = dspio_alloc_dma_chan(codec, &dma_chan);
                if (status < 0) {
                        snd_printdd(KERN_ERR "alloc dmachan fail");
-                       dma_chan = (unsigned int)INVALID_DMA_CHANNEL;
+                       dma_chan = INVALID_DMA_CHANNEL;
                        goto exit;
                }
        }
This page took 0.026719 seconds and 5 git commands to generate.