Message ID | 20210607222239.582139-2-pierre-louis.bossart@linux.intel.com |
---|---|
State | Accepted |
Commit | 468a272ca49cc4e2f58f3c360643c3f6d313c146 |
Headers | show |
Series | [01/15] ASoC: max98373-sdw: add missing memory allocation check | expand |
diff --git a/sound/soc/codecs/max98373-sdw.c b/sound/soc/codecs/max98373-sdw.c index f3a12205cd48..c7a3506046db 100644 --- a/sound/soc/codecs/max98373-sdw.c +++ b/sound/soc/codecs/max98373-sdw.c @@ -787,6 +787,8 @@ static int max98373_init(struct sdw_slave *slave, struct regmap *regmap) max98373->cache = devm_kcalloc(dev, max98373->cache_num, sizeof(*max98373->cache), GFP_KERNEL); + if (!max98373->cache) + return -ENOMEM; for (i = 0; i < max98373->cache_num; i++) max98373->cache[i].reg = max98373_sdw_cache_reg[i];