Skip to content

Commit

Permalink
ASoC: cs43130: fix a NULL pointer dereference
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
kengiter authored and broonie committed May 2, 2019
1 parent 51dd97d commit a2be42f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sound/soc/codecs/cs43130.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit a2be42f

Please sign in to comment.