summaryrefslogtreecommitdiffstats
path: root/sound/soc
diff options
context:
space:
mode:
authorKangjie Lu <kjlu@umn.edu>2019-03-15 04:48:32 +0100
committerMark Brown <broonie@kernel.org>2019-05-02 03:46:12 +0200
commit51dd97d1df5fb9ac58b9b358e63e67b530f6ae21 (patch)
tree22c262000af7b380cbfee7e6f8e331145c1206f2 /sound/soc
parentASoC: Intel: common: add Geminilake Realtek+Maxim machine driver entry (diff)
downloadlinux-51dd97d1df5fb9ac58b9b358e63e67b530f6ae21.tar.xz
linux-51dd97d1df5fb9ac58b9b358e63e67b530f6ae21.zip
ASoC: rt5645: fix a NULL pointer dereference
devm_kcalloc() may fail and return NULL. The fix returns ENOMEM in case it fails to avoid NULL pointer dereference. Signed-off-by: Kangjie Lu <kjlu@umn.edu> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/codecs/rt5645.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c
index 9a0751978090..f842775dbf2c 100644
--- a/sound/soc/codecs/rt5645.c
+++ b/sound/soc/codecs/rt5645.c
@@ -3419,6 +3419,9 @@ static int rt5645_probe(struct snd_soc_component *component)
RT5645_HWEQ_NUM, sizeof(struct rt5645_eq_param_s),
GFP_KERNEL);
+ if (!rt5645->eq_param)
+ return -ENOMEM;
+
return 0;
}