summaryrefslogtreecommitdiff
path: root/drivers/mfd
diff options
context:
space:
mode:
authorZidan Wang <zidan.wang@freescale.com>2015-12-01 16:14:26 +0800
committerJason Liu <jason.hui.liu@nxp.com>2019-02-12 10:23:58 +0800
commit14ab2d53f2134b116e0fe2adc1cd9f559f467658 (patch)
tree64035c98729007b1f86344140c2c6fc857da5fdb /drivers/mfd
parent8712106c6598e789752dd7dd6052bd0b75605556 (diff)
MLK-11933 mfd: mxc-hdmi-core: null check substream before using it
null check substream before using it. Reported by coverity. Signed-off-by: Zidan Wang <zidan.wang@freescale.com> (cherry picked from commit fad2b9c1285a34eab0dec9f90edc06ec94e70a61)
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/mxc-hdmi-core.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/mfd/mxc-hdmi-core.c b/drivers/mfd/mxc-hdmi-core.c
index ca79e7e4325a..a67040661b4a 100644
--- a/drivers/mfd/mxc-hdmi-core.c
+++ b/drivers/mfd/mxc-hdmi-core.c
@@ -153,9 +153,12 @@ int mxc_hdmi_register_audio(struct snd_pcm_substream *substream)
unsigned long flags, flags1;
int ret = 0;
+ if (!substream)
+ return -EINVAL;
+
snd_pcm_stream_lock_irqsave(substream, flags);
- if (substream && check_hdmi_state()) {
+ if (check_hdmi_state()) {
spin_lock_irqsave(&hdmi_audio_lock, flags1);
if (hdmi_audio_stream_playback) {
pr_err("%s unconsist hdmi auido stream!\n", __func__);