All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: rsnd: set dmaen->chan = NULL when error case
@ 2015-04-13  6:00 Kuninori Morimoto
  2015-04-15 16:05 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Kuninori Morimoto @ 2015-04-13  6:00 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA, Simon, Liam Girdwood

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(+)

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;
 	}
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ASoC: rsnd: set dmaen->chan = NULL when error case
  2015-04-13  6:00 [PATCH] ASoC: rsnd: set dmaen->chan = NULL when error case Kuninori Morimoto
@ 2015-04-15 16:05 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2015-04-15 16:05 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: Linux-ALSA, Simon, Liam Girdwood


[-- Attachment #1.1: Type: text/plain, Size: 365 bytes --]

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.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-04-15 16:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-13  6:00 [PATCH] ASoC: rsnd: set dmaen->chan = NULL when error case Kuninori Morimoto
2015-04-15 16:05 ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.