ASoC: AMD: free memory on error
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 13 Jan 2016 12:20:02 +0000 (15:20 +0300)
committerMark Brown <broonie@kernel.org>
Wed, 13 Jan 2016 12:32:04 +0000 (12:32 +0000)
Static checkers complain if we don't free "adata" before returning.

Fixes: 7c31335a03b6 ('ASoC: AMD: add AMD ASoC ACP 2.x DMA driver')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/amd/acp-pcm-dma.c

index 3191e0a7d273213515ccd3e049e66c4f6ddc5f67..d1fb035f44db8fd7026d97e1148f0c09eb4d1679 100644 (file)
@@ -635,6 +635,7 @@ static int acp_dma_open(struct snd_pcm_substream *substream)
                                            SNDRV_PCM_HW_PARAM_PERIODS);
        if (ret < 0) {
                dev_err(prtd->platform->dev, "set integer constraint failed\n");
+               kfree(adata);
                return ret;
        }