All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fabio Estevam <festevam@gmail.com>
To: alsa-devel@alsa-project.org
Cc: joancarles@fqingenieria.es,
	Fabio Estevam <fabio.estevam@freescale.com>,
	broonie@opensource.wolfsonmicro.com,
	Fabio Estevam <festevam@gmail.com>,
	kernel@pengutronix.de
Subject: [PATCH 2/2] ASoC: imx-audmux: Check for NULL pointer
Date: Thu,  5 Apr 2012 09:45:52 -0300	[thread overview]
Message-ID: <1333629952-18243-2-git-send-email-festevam@gmail.com> (raw)
In-Reply-To: <1333629952-18243-1-git-send-email-festevam@gmail.com>

Check for NULL pointer before accessing it.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 sound/soc/fsl/imx-audmux.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/sound/soc/fsl/imx-audmux.c b/sound/soc/fsl/imx-audmux.c
index d467a1b..21d67bb 100644
--- a/sound/soc/fsl/imx-audmux.c
+++ b/sound/soc/fsl/imx-audmux.c
@@ -76,6 +76,9 @@ static ssize_t audmux_read_file(struct file *file, char __user *user_buf,
 	if (audmux_clk)
 		clk_prepare_enable(audmux_clk);
 
+	if (!audmux_base)
+		return -ENOSYS;
+
 	ptcr = readl(audmux_base + IMX_AUDMUX_V2_PTCR(port));
 	pdcr = readl(audmux_base + IMX_AUDMUX_V2_PDCR(port));
 
-- 
1.7.1

  reply	other threads:[~2012-04-05 12:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-05 12:45 [PATCH 1/2] ASoC: imx-audmux: Fix ssi port numbers in sysfs Fabio Estevam
2012-04-05 12:45 ` Fabio Estevam [this message]
     [not found]   ` <4F7D94CC.80300@pengutronix.de>
2012-04-05 12:55     ` [PATCH 2/2] ASoC: imx-audmux: Check for NULL pointer Mark Brown
2012-04-05 14:25 ` [PATCH 1/2] ASoC: imx-audmux: Fix ssi port numbers in sysfs Mark Brown

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=1333629952-18243-2-git-send-email-festevam@gmail.com \
    --to=festevam@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=fabio.estevam@freescale.com \
    --cc=joancarles@fqingenieria.es \
    --cc=kernel@pengutronix.de \
    /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 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.