From: Kangjie Lu Date: Fri, 15 Mar 2019 03:51:20 +0000 (-0500) Subject: ASoC: cs43130: fix a NULL pointer dereference X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=a2be42f18d409213bb7e7a736e3ef6ba005115bb;p=linux.git 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 Signed-off-by: Mark Brown --- diff --git a/sound/soc/codecs/cs43130.c b/sound/soc/codecs/cs43130.c index 3f7b255587e6a..80d672710eaef 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); }