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>
This commit is contained in:
Kangjie Lu 2019-03-14 22:48:32 -05:00 committed by Mark Brown
parent d3692cb5c5
commit 51dd97d1df
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0

View File

@ -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;
}