mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 03:44:45 +01:00
ASoC: codecs: wcd-common: fix signedness bug in wcd_dt_parse_micbias_info()
The error handling does not work because common->micb_vout[] is an array
of u32. We need a signed variable to store negative error codes.
Fixes: 4f16b6351b ("ASoC: codecs: wcd: add common helper for wcd codecs")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Link: https://patch.msgid.link/aNKEZ3VqJ8js208v@stanley.mountain
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
2cc6710595
commit
dc64b3d42c
1 changed files with 5 additions and 4 deletions
|
|
@ -62,12 +62,13 @@ static int wcd_get_micbias_val(struct device *dev, int micb_num, u32 *micb_mv)
|
|||
|
||||
int wcd_dt_parse_micbias_info(struct wcd_common *common)
|
||||
{
|
||||
int i;
|
||||
int ret, i;
|
||||
|
||||
for (i = 0; i < common->max_bias; i++) {
|
||||
common->micb_vout[i] = wcd_get_micbias_val(common->dev, i + 1, &common->micb_mv[i]);
|
||||
if (common->micb_vout[i] < 0)
|
||||
return -EINVAL;
|
||||
ret = wcd_get_micbias_val(common->dev, i + 1, &common->micb_mv[i]);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
common->micb_vout[i] = ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue