diff mbox

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

Message ID 87oams7elr.wl%kuninori.morimoto.gx@renesas.com (mailing list archive)
State Accepted
Commit d1acba2fdebb449bad01e7cf77a9f9730dfaca6e
Headers show

Commit Message

Kuninori Morimoto April 13, 2015, 6 a.m. UTC
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

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>
---
 sound/soc/sh/rcar/dma.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Mark Brown April 15, 2015, 4:05 p.m. UTC | #1
On Mon, Apr 13, 2015 at 06:00:45AM +0000, Kuninori Morimoto wrote:
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> 
> 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())

Applied, thanks.
diff mbox

Patch

diff --git a/sound/soc/sh/rcar/dma.c b/sound/soc/sh/rcar/dma.c
index ac3756f..144308f 100644
--- a/sound/soc/sh/rcar/dma.c
+++ b/sound/soc/sh/rcar/dma.c
@@ -156,6 +156,7 @@  static int rsnd_dmaen_init(struct rsnd_priv *priv, struct rsnd_dma *dma, int id,
 						  (void *)id);
 	}
 	if (IS_ERR_OR_NULL(dmaen->chan)) {
+		dmaen->chan = NULL;
 		dev_err(dev, "can't get dma channel\n");
 		goto rsnd_dma_channel_err;
 	}