alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
To: Mark Brown <broonie@kernel.org>
Cc: Linux-ALSA <alsa-devel@alsa-project.org>,
	Simon <horms@verge.net.au>, Liam Girdwood <lgirdwood@gmail.com>
Subject: [PATCH 11/20] ASoC: rsnd: tidyup rsnd_io_to_runtime() macro
Date: Thu, 27 Nov 2014 08:06:25 +0000	[thread overview]
Message-ID: <87r3wp83ud.wl%kuninori.morimoto.gx@renesas.com> (raw)
In-Reply-To: <877fyh9ilx.wl%kuninori.morimoto.gx@renesas.com>

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Avoid NULL pointer access

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 sound/soc/sh/rcar/rsnd.h |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h
index 133ba1f..5826c8a 100644
--- a/sound/soc/sh/rcar/rsnd.h
+++ b/sound/soc/sh/rcar/rsnd.h
@@ -303,7 +303,8 @@ struct rsnd_dai *rsnd_dai_get(struct rsnd_priv *priv, int id);
 int rsnd_dai_is_play(struct rsnd_dai *rdai, struct rsnd_dai_stream *io);
 int rsnd_dai_id(struct rsnd_priv *priv, struct rsnd_dai *rdai);
 #define rsnd_dai_get_platform_info(rdai) ((rdai)->info)
-#define rsnd_io_to_runtime(io) ((io)->substream->runtime)
+#define rsnd_io_to_runtime(io) ((io)->substream ? \
+				(io)->substream->runtime : NULL)
 
 void rsnd_dai_pointer_update(struct rsnd_dai_stream *io, int cnt);
 int rsnd_dai_pointer_offset(struct rsnd_dai_stream *io, int additional);
-- 
1.7.9.5

  parent reply	other threads:[~2014-11-27  8:06 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-27  8:02 [PATCH 0/20] ASoC: rsnd: add Synchronous SRC and U/O error salvage support Kuninori Morimoto
2014-11-27  8:02 ` [PATCH 01/20] ASoC: rsnd: add .fallback callback Kuninori Morimoto
2014-11-27  8:02 ` [PATCH 02/20] ASoC: rsnd: add callback status check method Kuninori Morimoto
2014-11-27  8:03 ` [PATCH 03/20] ASoC: rsnd: rsnd_src_ssiu_stop() stops SSIU compulsorily Kuninori Morimoto
2014-11-27  8:05 ` [PATCH 04/20] ASoC: rsnd: tidyup PIO/DMA mode settings method Kuninori Morimoto
2014-11-27  8:05 ` [PATCH 05/20] ASoC: rsnd: tidyup SSI interrupt enable/disable method Kuninori Morimoto
2014-11-27  8:05 ` [PATCH 06/20] ASoC: rsnd: care SSIWSR register in rsnd_ssi_hw_start() Kuninori Morimoto
2014-11-27  8:05 ` [PATCH 07/20] ASoC: rsnd: clear status register when HW start Kuninori Morimoto
2014-11-27  8:05 ` [PATCH 08/20] ASoC: rsnd: synchronize SSI start/stop sequence between PIO/DMA mode Kuninori Morimoto
2014-11-27  8:06 ` [PATCH 09/20] ASoC: rsnd: show master clock rate when ADG probe Kuninori Morimoto
2014-11-27  8:06 ` [PATCH 10/20] ASoC: rsnd: move snd_kcontrol_new fucntions to core.c Kuninori Morimoto
2014-11-27  8:06 ` Kuninori Morimoto [this message]
2014-11-27  8:06 ` [PATCH 12/20] ASoC: rsnd: use rsnd_src_convert_rate() once on rsnd_src_set_convert_rate_gen2() Kuninori Morimoto
2014-11-27  8:06 ` [PATCH 13/20] ASoC: rsnd: initialize SRC on rsnd_src_init() Kuninori Morimoto
2014-11-27  8:07 ` [PATCH 14/20] ASoC: rsnd: set SRC_ROUTE_MODE0 on each rsnd_src_set_convert_rate() Kuninori Morimoto
2014-11-27  8:07 ` [PATCH 15/20] ASoC: rsnd: share SSI starting method between PIO/DMA mode Kuninori Morimoto
2014-11-27  8:07 ` [PATCH 16/20] ASoC: rsnd: remove un-necessary parameter from rsnd_src_start/stop() Kuninori Morimoto
2014-12-03 18:52   ` Mark Brown
2014-11-27  8:07 ` [PATCH 17/20] ASoC: rsnd: add Synchronous SRC mode Kuninori Morimoto
2014-11-27  8:07 ` [PATCH 18/20] ASoC: rsnd: add salvage support for under/over flow error on SSI Kuninori Morimoto
2014-12-07 13:45   ` Mark Brown
2014-11-27  8:08 ` [PATCH 19/20] ASoC: rsnd: add salvage support for under/over flow error on SRC Kuninori Morimoto
2014-11-27  8:08 ` [PATCH 20/20] ASoC: rsnd: rename SSI function name of PIO Kuninori Morimoto
2014-12-07 13:46   ` Mark Brown
2014-12-24  2:01 ` [PATCH 0/20] ASoC: rsnd: add Synchronous SRC and U/O error salvage support Kuninori Morimoto
2014-12-30 17:10   ` Mark Brown
2015-01-05  0:42     ` Kuninori Morimoto
2015-01-06 18:33       ` Mark Brown
2015-01-07  4:12         ` Kuninori Morimoto
2015-01-08 17:44           ` Pierre-Louis Bossart
2015-01-10 11:32             ` Mark Brown
2015-01-14  1:11               ` Kuninori Morimoto
2015-01-19 20:49                 ` Mark Brown
2015-01-20  2:10                   ` Kuninori Morimoto
2015-02-24 14:56                     ` Mark Brown
2015-01-08  1:50 ` Kuninori Morimoto
2015-01-08  1:52   ` [PATCH v2] ASoC: rsnd: add recovery support for under/over flow error on SRC Kuninori Morimoto
2015-01-12 13:03     ` Mark Brown
2015-01-13  7:20       ` Kuninori Morimoto
2015-01-15 15:58         ` Mark Brown
2015-01-16  0:08           ` Kuninori Morimoto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r3wp83ud.wl%kuninori.morimoto.gx@renesas.com \
    --to=kuninori.morimoto.gx@renesas.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=horms@verge.net.au \
    --cc=lgirdwood@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).