Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: nau8821: check regmap_raw_read/regmap_raw_write for failure

The return values from both regmap_raw_read() and regmap_raw_write() are not
checked despite they can fail. Propagate possible errors to caller.

Found by Linux Verification Center (linuxtesting.org) with Svace.

Signed-off-by: Vitaliy Shevtsov <v.shevtsov@maxima.ru>
Link: https://patch.msgid.link/20241018110743.18786-1-v.shevtsov@maxima.ru
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Vitaliy Shevtsov and committed by
Mark Brown
1b9971a4 b2385de2

+4 -5
+4 -5
sound/soc/codecs/nau8821.c
··· 287 287 if (!component->regmap) 288 288 return -EINVAL; 289 289 290 - regmap_raw_read(component->regmap, NAU8821_R21_BIQ0_COF1, 290 + return regmap_raw_read(component->regmap, NAU8821_R21_BIQ0_COF1, 291 291 ucontrol->value.bytes.data, params->max); 292 - 293 - return 0; 294 292 } 295 293 296 294 static int nau8821_biq_coeff_put(struct snd_kcontrol *kcontrol, ··· 297 299 struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 298 300 struct soc_bytes_ext *params = (void *)kcontrol->private_value; 299 301 void *data; 302 + int ret; 300 303 301 304 if (!component->regmap) 302 305 return -EINVAL; ··· 307 308 if (!data) 308 309 return -ENOMEM; 309 310 310 - regmap_raw_write(component->regmap, NAU8821_R21_BIQ0_COF1, 311 + ret = regmap_raw_write(component->regmap, NAU8821_R21_BIQ0_COF1, 311 312 data, params->max); 312 313 313 314 kfree(data); 314 315 315 - return 0; 316 + return ret; 316 317 } 317 318 318 319 static const char * const nau8821_adc_decimation[] = {