Commit a2be42f1 authored by Kangjie Lu's avatar Kangjie Lu Committed by Mark Brown

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: default avatarKangjie Lu <kjlu@umn.edu>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 51dd97d1
...@@ -2322,6 +2322,8 @@ static int cs43130_probe(struct snd_soc_component *component) ...@@ -2322,6 +2322,8 @@ static int cs43130_probe(struct snd_soc_component *component)
return ret; return ret;
cs43130->wq = create_singlethread_workqueue("cs43130_hp"); cs43130->wq = create_singlethread_workqueue("cs43130_hp");
if (!cs43130->wq)
return -ENOMEM;
INIT_WORK(&cs43130->work, cs43130_imp_meas); INIT_WORK(&cs43130->work, cs43130_imp_meas);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment