summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorKangjie Lu <kjlu@umn.edu>2019-03-15 06:51:20 +0300
committerMark Brown <broonie@kernel.org>2019-05-02 04:46:13 +0300
commita2be42f18d409213bb7e7a736e3ef6ba005115bb (patch)
treeeaa62849d591409ab40a40cc1e6cea53f5665a82 /sound
parent51dd97d1df5fb9ac58b9b358e63e67b530f6ae21 (diff)
downloadlinux-a2be42f18d409213bb7e7a736e3ef6ba005115bb.tar.xz
ASoC: cs43130: fix a NULL pointer dereference
In case create_singlethread_workqueue fails, the fix returns -ENOMEM to avoid potential NULL pointer dereference. Signed-off-by: Kangjie Lu <kjlu@umn.edu> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/cs43130.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/soc/codecs/cs43130.c b/sound/soc/codecs/cs43130.c
index 3f7b255587e6..80d672710eae 100644
--- a/sound/soc/codecs/cs43130.c
+++ b/sound/soc/codecs/cs43130.c
@@ -2322,6 +2322,8 @@ static int cs43130_probe(struct snd_soc_component *component)
return ret;
cs43130->wq = create_singlethread_workqueue("cs43130_hp");
+ if (!cs43130->wq)
+ return -ENOMEM;
INIT_WORK(&cs43130->work, cs43130_imp_meas);
}