ASoC: rsnd: set dmaen->chan = NULL when error case

rsnd_dmaen_quit() is assuming dmaen->chan is NULL if it failed
to get DMAEngine channel. but, current dmaen->chan might have
error value when error case (this driver is checking it by IS_ERR_OR_NULL())
This patch makes sure dmaen->chan is NULL when error case.
Otherwise, it will contact to unknown address in rsnd_dmaen_quit()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Kuninori Morimoto 2015-04-13 06:00:45 +00:00 committed by Mark Brown
parent 7667428f80
commit d1acba2fde
1 changed files with 1 additions and 0 deletions

View File

@ -156,6 +156,7 @@ static int rsnd_dmaen_init(struct rsnd_priv *priv, struct rsnd_dma *dma, int id,
(void *)id); (void *)id);
} }
if (IS_ERR_OR_NULL(dmaen->chan)) { if (IS_ERR_OR_NULL(dmaen->chan)) {
dmaen->chan = NULL;
dev_err(dev, "can't get dma channel\n"); dev_err(dev, "can't get dma channel\n");
goto rsnd_dma_channel_err; goto rsnd_dma_channel_err;
} }